Question

I'm working on a maven project and want to generate the most basic of javadocs.

This is the plugin I add to my pom.xml

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

I then run the goal mvn clean package and after successfully cleaning and packaging my project it says

[INFO] --- maven-javadoc-plugin:2.8.1:jar (attach-javadocs) @ project-name ---
[INFO] Skipping javadoc generation.

I've tried adding the property:

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

And have also tried this in cmd prompt:

mvn clean package -Dmaven.javadoc.skip=false

No different...

Anything I am blatantly missing?

Was it helpful?

Solution 2

see the effective pom of your project either on the command line by typing mvn help:effective-pom or through eclipse effective-pom view of your pom. That will give you the true configuration. If the flag is set to true, then:

  1. are you adding the configuration in an inactive profile? check mvn help:active-profiles
  2. do you have pom inheritance and inheriting the configuration from the parents? check parent poms

I don't think that changing the version will help you much as the "skip" parameter was available from version 2.5

OTHER TIPS

You must use

-Dmaven.javadoc.skip=true <-- to skip javadoc

-Dmaven.javadoc.skip=false <<-- do not skip

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top