0

I want maven-javadoc-plugin to be skipped by default, during the mvn clean install command, so I have added <skip>true<skip> in the pom.xml But I want it to be executed whenever needed, so I am trying something like mvn clean install -Dmaven.javadoc.skip=false But it seems that it is overriding this setting with that in pom.xml and not executing the javadoc plugin.

What can I do to resolve this problem?

Bosco
  • 3,835
  • 6
  • 25
  • 33

1 Answers1

0

You could create a profile for the plugin execution (move it from the normal build generation). Within the profile, simply state that the plugin should run when you want it. The idea is that when you do a run without the profile included in arguments, it won't run; if you include the profile argument, it'll be kicked off:

http://maven.apache.org/guides/introduction/introduction-to-profiles.html

Run arguments would look something like: mvn groupId:artifactId:goal -P profile-1