sparsick commented on code in PR #675:
URL: https://github.com/apache/maven-pmd-plugin/pull/675#discussion_r2624186258
##########
pom.xml:
##########
@@ -282,7 +276,17 @@ under the License.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.21.0</version>
+ <version>2.20.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
Review Comment:
yes, because if I remove it then I get following error:
```
[ERROR]
org.apache.maven.plugins.pmd.CpdViolationCheckMojoTest.testNotFailOnViolation(CpdViolationCheckMojo)
-- Time elapsed: 0.046 s <<< ERROR!
org.junit.jupiter.api.extension.ParameterResolutionException: Unable to
resolve parameter
at
org.apache.maven.api.plugin.testing.MojoExtension.resolveParameter(MojoExtension.java:176)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by:
org.codehaus.plexus.component.configurator.ComponentConfigurationException:
Cannot create instance of class
org.apache.maven.plugins.pmd.stubs.DefaultConfigurationMavenProjectStub
at
org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.instantiateObject(AbstractConfigurationConverter.java:184)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.fromConfiguration(ObjectWithFieldsConverter.java:60)
at
org.eclipse.sisu.plexus.CompositeBeanHelper.convertProperty(CompositeBeanHelper.java:265)
at
org.eclipse.sisu.plexus.CompositeBeanHelper.setProperty(CompositeBeanHelper.java:202)
at
org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:157)
at
org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:37)
at
org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:45)
at
org.apache.maven.api.plugin.testing.MojoExtension.lookupMojo(MojoExtension.java:411)
at
org.apache.maven.api.plugin.testing.MojoExtension.lookupMojo(MojoExtension.java:354)
at
org.apache.maven.api.plugin.testing.MojoExtension.resolveParameter(MojoExtension.java:174)
... 2 more
Caused by: java.lang.NoClassDefFoundError: junit/framework/TestCase
at
org.apache.maven.plugin.testing.stubs.MavenProjectStub.getBasedir(MavenProjectStub.java:291)
at
org.apache.maven.plugins.pmd.stubs.PmdProjectStub.getBasedir(PmdProjectStub.java:84)
at
org.apache.maven.plugins.pmd.stubs.DefaultConfigurationMavenProjectStub.getBasedir(DefaultConfigurationMavenProjectStub.java:42)
at
org.apache.maven.plugins.pmd.stubs.PmdProjectStub.<init>(PmdProjectStub.java:47)
at
org.apache.maven.plugins.pmd.stubs.DefaultConfigurationMavenProjectStub.<init>(DefaultConfigurationMavenProjectStub.java:37)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at
java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/java.lang.Class.newInstance(Class.java:725)
at
org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter.instantiateObject(AbstractConfigurationConverter.java:176)
... 11 more
Caused by: java.lang.ClassNotFoundException: junit.framework.TestCase
... 20 more
```
I will add a comment to the pom.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]