I have the following:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
Which works fine during packaging or installing:
mvn install or mvn package, however, as soon as I try to specify a TestNG Group to run for the tests:
mvn install -Dgroups=somegroup
it fails with the following error after tests finish running:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (javadoc-jar) on project ibd.database.api: Unable to parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar for parameter #: Cannot find default setter in class org.apache.maven.plugin.javadoc.options.Group
Thanks for any info or guidance on this.
The problem is that both the surefire and javadoc plugins use the -Dgroups parameter, and in your case the javadoc plugin cannot find the "somegroup".
As far as I know there is no clean solution for this, but you can do a workaround by defining a custom property in your pom.xml:
<properties>
<surefire.groups></surefire.groups>
</properties>
Then use the property in the surefire configuration:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
...
<configuration>
<groups>${surefire.groups}</groups>
</configuration>
</plugin>
Now you can run the tests from command line using the surefire.groups property:
mvn install -Dsurefire.groups=somegroup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With