Maven "Skipping javadoc generation" WHY?

12,714

Solution 1

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

Solution 2

You must use

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

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

Share:
12,714
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    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?

  • Admin
    Admin about 11 years
    I did the mvn help:effective-pom and saw <skip>true</skip> under the javadocs plugin configuration. So I added <skip>false</skip> into my javadoc plugin configuration in my POM files and its now working :) Thanks a lot
  • Admin
    Admin about 11 years
    Oh, and to answer your 2nd question.. I do actually have my parent pom referencing another parent pom. I'll check its configuration
  • Admin
    Admin about 11 years
    And sure enough... that's where its set to true. I see now haha.. Problem solved.
  • St.Shadow
    St.Shadow over 7 years
    Question is about how not to skip a javadoc.