Maven "Skipping javadoc generation" WHY?
Asked Answered
P

2

9

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?

Phosphatize answered 25/3, 2013 at 2:5 Comment(5)
Have you configured the org.apache.maven.plugins:maven-javadoc-plugin under the build or reporting?Uvular
Sorry, yeah it's under build.Phosphatize
Could you try two things? Use the latest (2.9) version of the javadoc plugin? Also omit the phase configuration as per this cookbook?Agostino
Due to network restrictions I cannot get to 2.9. The version 2.8.1 works on another PC I have tried it on. So I'm quite sure that it's not to do with the version. Also after removing the phase configuration... same outcome.Phosphatize
can run mvn with -X option and post the relevant output ?Hustle
F
8

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

Favianus answered 25/3, 2013 at 11:9 Comment(3)
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 lotPhosphatize
Oh, and to answer your 2nd question.. I do actually have my parent pom referencing another parent pom. I'll check its configurationPhosphatize
And sure enough... that's where its set to true. I see now haha.. Problem solved.Phosphatize
R
13

You must use

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

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

Rebut answered 7/7, 2014 at 21:57 Comment(1)
Question is about how not to skip a javadoc.Dolt
F
8

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

Favianus answered 25/3, 2013 at 11:9 Comment(3)
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 lotPhosphatize
Oh, and to answer your 2nd question.. I do actually have my parent pom referencing another parent pom. I'll check its configurationPhosphatize
And sure enough... that's where its set to true. I see now haha.. Problem solved.Phosphatize

© 2022 - 2024 — McMap. All rights reserved.