/    Sign up×
Community /Pin to ProfileBookmark

Maven javadoc POM example

Hi

in maven POM, I configure
<build>
<sourceDirectory>src/main/</sourceDirectory>

but when i mvn javadoc:javadoc to create javadocs it says Source file not found.

Actually Source package start at src/main/java/ but if i put like that it failed to build the source.

I need able build and run javadoc with same build name or i need able to give path for javadoc plugin where the source is.

this is POM example for javadoc genarator from maven

<reporting>
<plugins>
<!– turn off all project-info-reports (they run by default) –>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<aggregate>true</aggregate>
<minmemory>128m</minmemory>
<maxmemory>512</maxmemory>
<breakiterator>true</breakiterator>
<quiet>true</quiet>
<source>1.5</source>
<verbose>false</verbose>
<linksource>true</linksource>
<links>
<!– JSE –>
<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
<link>http://java.sun.com/j2se/1.4.2/docs/api/</link>
<link>http://java.sun.com/j2se/1.3/docs/api/</link>

<!– JEE –>
<link>http://java.sun.com/j2ee/1.4/docs/api/</link>
<link>http://java.sun.com/j2ee/sdk_1.3/techdocs/api/</link>

<!– Libraries –>
<!– <link>http://jakarta.apache.org/commons/collections/apidocs</link>
<link>http://jakarta.apache.org/commons/logging/apidocs/</link>
<link>http://www.junit.org/junit/javadoc/</link> –>
<link>http://logging.apache.org/log4j/docs/api/</link>
<link>http://jakarta.apache.org/regexp/apidocs/</link>
<link>http://jakarta.apache.org/velocity/api/</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>

<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
</plugins>
</reporting>

Thanks?

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@csjanakasauthorJan 31.2008 — Hi

mvn javadoc:javadoc get the source path from build source path.

But there is a way to tell javadoc to look for this palace for source.

<reporting>

<plugins>

<!-- turn off all project-info-reports (they run by default) -->

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-project-info-reports-plugin</artifactId>

</plugin>

<plugin>

<artifactId>maven-javadoc-plugin</artifactId>

<configuration>

<aggregate>true</aggregate>

<minmemory>128m</minmemory>

<maxmemory>512</maxmemory>

<breakiterator>true</breakiterator>

<quiet>true</quiet>

<source>1.5</source>

<verbose>false</verbose>

<sourcepath>${maindir}/Module1/src/main/java/;${maindir}/Module2/src/main/java/

</sourcepath>

<linksource>true</linksource>

<links>
<!-- JSE -->
<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
<link>http://java.sun.com/j2se/1.4.2/docs/api/</link>
<link>http://java.sun.com/j2se/1.3/docs/api/</link>

<!-- JEE -->
<link>http://java.sun.com/j2ee/1.4/docs/api/</link>
<link>http://java.sun.com/j2ee/sdk_1.3/techdocs/api/</link>

<!-- Libraries -->
<!-- <link>http://jakarta.apache.org/commons/collections/apidocs</link>
<link>http://jakarta.apache.org/commons/logging/apidocs/</link>
<link>http://www.junit.org/junit/javadoc/</link> -->
<link>http://logging.apache.org/log4j/docs/api/</link>
<link>http://jakarta.apache.org/regexp/apidocs/</link>
<link>http://jakarta.apache.org/velocity/api/</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>

<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
</plugins>
</reporting>




...................

here {maindir} should define in side build.properties file.
Copy linkTweet thisAlerts:
@csjanakasauthorJan 31.2008 — I have try to do this. finally i was able. so i thought of publish here. I hope No one will complain ?
×

Success!

Help @csjanakas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...