| Author |
How to fix this dependency for mvn javadoc:javadoc?
|
Fredrik Andersson
Ranch Hand
Joined: May 03, 2005
Posts: 35
|
|
Hello!
We need to write an taglet for own generation of javadoc.
The idea is to produce a special javadoc for our code.
It should produce documentation for some annotations we use, in a separate doc.
The taglet is parameterized with the name of the class it is used in.
When it run it use reflection to look inside the class it is used in and look for certain annotations.
We have put our taglet in a common lib.
Please se quick-sketch-dependency-diagram at:
As you can see our code in test got dependency to the common-lib but of course not vice versa.
Classes in test use the taglet.
But when we step into the test-project and run mvn javadoc:javadoc we get an class not found when the taglet is executed.
This is probably because the common-lib does not got dependency back to test.
In the taglet in common we do like:
Class c = Class.forName(tags[0].text());
Is there a way to let classes in common find and instance classes from test when we run mvn javadoc:javadoc?
Do you guys see any solution to this problem?
Best regards
Fredrik
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 11740
|
|
You shouldn't really need to explicitly include the name of the class on your tag. Unless I'm mistaken, the annotation processor can figure that out by itself. But that's not really your problem.
From the sound of it, you're essentially extending javadoc. Javadoc, like all the other tools that Maven employs, is expected to be external to - and independent of - the project. So it's not really reasonable to expect it to include data from within the project as part of its runtime class environment.
In other words, you should develop your extensions in a separate project, package them as needed, and include them as a JAR file (or whatever) to the JavaDoc goal. There should be a way to add extensions to the JavaDoc classpath in a POM that runs JavaDoc.
|
A lot the of modern-day software development platforms are designed to permit parcelling out work to those with the best aptitude for it. A lot of modern-day business is predicated on making one person do all the work, regardless of aptitude.
|
 |
Fredrik Andersson
Ranch Hand
Joined: May 03, 2005
Posts: 35
|
|
Hello!
Thanks for your reply!
I tried this in test.pom
(But I still get the java.lang.ClassNotFoundException: test.Tester)
The class test.Tester is inside test, test 1.0.0
It seems that it can't find it in some way?
If you see anything fishy please let me know!
Best regards
Fredrik
|
 |
Fredrik Andersson
Ranch Hand
Joined: May 03, 2005
Posts: 35
|
|
Hello amigos!
I had to write a new JarClassLoader to dynamically load the jars.
I'm really not happy with this solution, but I think it fixes my problem for now!
Best regards
Fredrik
|
 |
 |
|
|
subject: How to fix this dependency for mvn javadoc:javadoc?
|
|
|