Skip to content

AddMockitoJavaAgentToMavenSurefirePlugin inserts odd empty argLine and configures dependency-plugin for no apparent reason? #1168

Description

@gjoseph

What version of OpenRewrite are you using?

rewrite-maven-plugin:6.43
rewrite-migrate-java:3.39

Previously used 6.41 and 3.36 respectively, which didn't exhibit this behaviour
I've tried 6.44 with 3.40, same issue.

How are you running OpenRewrite?

I am using the Maven plugin, in a multi-module project.

What is the smallest, simplest way to reproduce the problem?

./mvnw rewrite:dryRun -DfailOnDryRunResults=true

The 2 modules where the issue occurs are the only 2 that use mockito, so that makes sense, but I can't explain the changes it makes. Generated patch files: rewrite.patch

What did you expect to see?

Either nothing at all, or an "argLine" that actually sets up the mockito agent, and didn't expect the dependency-plugin block at all?
Additionally -- ideally -- this'd be added to the pluginManagement in the parent pom.

What did you see instead?

See attached patch

What is the full stack trace of any errors you encountered?

n/a

Are you interested in contributing a fix to OpenRewrite?

Not opposed, but very unlikely I'm getting bandwidth in the short term

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions