Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

In pom.xml I have declaration like this

    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
                    <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                    <goal>jar</goal>
                            </goals>
                    </execution>
            </executions>
    </plugin>

is there any way to turn that off from command line?

P.S. I do know I can extract that into a profile, but that is not what I want.

share|improve this question
up vote 165 down vote accepted

The Javadoc generation can be skipped by setting the property maven.javadoc.skip to true [1], i.e.

-Dmaven.javadoc.skip=true

(and not false)

share|improve this answer
1  
What's the point of repeating @Vineet Reynolds answer 6 months after ? – Snicolas Dec 15 '12 at 12:20
8  
@Snicolas his answer got the boolean wrong. – Thorbjørn Ravn Andersen Feb 27 '13 at 11:51
5  
how in the world can I remember this flag name? – javadba Jul 8 '15 at 19:06

You can use the maven.javadoc.skip property to skip execution of the plugin, going by the Mojo's javadoc. You can specify the value as a Maven property:

<properties>
    <maven.javadoc.skip>true</maven.javadoc.skip>
</properties>

or as a command-line argument: -Dmaven.javadoc.skip=true, to skip generation of the Javadocs.

share|improve this answer
2  
It must be true instead of false. – PomCompot Jul 18 '13 at 12:46
    
@PomCompot: Corrected. – sleske Jul 30 '13 at 7:43
1  
Thanks a lot. This plugins caused my android release build to fail. – Bevor Jan 24 '15 at 20:09

It seems, that the simple way

-Dmaven.javadoc.skip=true

does not work with the release-plugin. in this case i had to pass the parameter as an "argument"

mvn release:perform -Darguments="-Dmaven.javadoc.skip=true"

regards Tobias

PS: my environment is windows 10 x64

share|improve this answer
    
The -Darguments method worked for me. mvn release:perform seems to ignore javadoc related settings in pom.xml. – Lupius Feb 23 at 19:06
    
it works fine with -Darguments. Thanks ! – François SAMIN Mar 23 at 13:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.