Issue Details (XML | Word | Printable)

Key: MJAVADOC-138
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Siveton
Reporter: Vincent Siveton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Javadoc Plugin

javadoc:test-javadoc failed if target/classes not already created

Created: 26/Jul/07 09:41 PM   Updated: 31/May/08 06:43 AM   Resolved: 31/May/08 06:43 AM
Return to search
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.5

Time Tracking:
Not Specified

Issue Links:
Related
 


 Description  « Hide

Using

mvn clean javadoc:test-javadoc

it could produce unsuccessful build or warning (depending the javadoc version used, i.e 1.4 vs 1.5)

The options file contains:

-classpath '[SNIP]/target/classes;[SNIP]/target/tests-classes;...'

The explanation is that no target\classes was created before executing test-javadoc



Benjamin Bentmann added a comment - 12/Oct/07 04:01 AM

Well, why to depend on the compiled classes of the project anyway? Regarding the currently build project, you have something better than just bytecode, the sources! Unlike the class files, the sources carry documentation that javadoc can use to inherit documentation (e.g. for overriden methods). So, instead of

-classpath '[SNIP]/target/classes;[SNIP]/target/tests-classes;...'

I would rather aim at

-classpath '...'
-sourcepath '[SNIP]/src/main/java;[SNIP]/src/test/java;...'

However, just including the project main sources on the source path has an unwanted effect: One will likely get Javadoc for production classes if those happen to reside in the same package as some test class (a common scenario for organizing tests). This effect stems from the fact, that the plugin currently specifies which packages to document and javadoc cannot distinguish from main and test sources. But that is easily solved: Instead of listing up packages, the plugin simply needs to scan all test source directories for Java files and put those in an arg file.


Vincent Siveton added a comment - 17/Jan/08 07:41 AM

Benjamin, could you provide us a patch?


Benjamin Bentmann added a comment - 17/Jan/08 04:26 PM

I really should stop commenting on other people's issues... Not sure if I am willing to spend time on this. I will check out its complexity during the weekend and let you know if I go for it or not.


Benjamin Bentmann added a comment - 20/Jan/08 11:16 AM

Vincent, if there is urgent need to get this done, I can't help. If it can wait a couple of weeks, well, I will try.

As a hotfix, annotating the mojo with @execute phase=test-compile to create the test classes by a forked Maven invocation should do.


Vincent Siveton added a comment - 29/Jan/08 06:34 PM

Benjamin, it is not so urgent, I am happy to waiting for it


Vincent Siveton added a comment - 31/May/08 06:43 AM

Should be closed by MJAVADOC-168