Avatar billede fredand Forsker
13. august 2010 - 21:15 Der er 1 kommentar og
1 løsning

How to fix this dependency for mvn javadoc:javadoc?

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.

When it runs it should use reflection to look inside the class and look for certain annotations.

We have put our taglet in a common lib.
Please se quick-sketch-dependency-diagram at:
http://fredand44.webs.com/bilder/javadoc_problem.jpg

As you can see our code in test got dependency to the common-lib but of course not vice versa.

But when we step into the test-project and run mvn javadoc:javadoc we get en class not found when the taglet is run.
This is because the common lib does not got dependency back to test.
In the taglet we do like:
Class c = Class.forName(tags[0].text());

Do you guys see any solution to this problem?
Best regards
Fredrik
Avatar billede fredand Forsker
21. august 2010 - 21:40 #1
This really seems so strange that I can not get to work.

Simple, the taglet uses reflection to look inside a class. But when it does that I get class not found for test.Tester which in test-1.0.0.jar.

I have tried this in my maven-javadoc-plugin:

                    <additionalClasspathElements>
                          <additionalClasspathElement>/home/fredrik/workspaces/eclipse_workspaces/annotation_javadoc_workspace/test/target/test/test-1.0.0.jar</additionalClasspathElement>
                    </additionalClasspathElements>
                   
                    <bootclasspath>/home/fredrik/workspaces/eclipse_workspaces/annotation_javadoc_workspace/test/target/test/test-1.0.0.jar:/usr/lib/jvm/java-1.6.0-sun-1.6.0.16/jre/lib/rt.jar</bootclasspath> 
                   
                    <bootclasspathArtifacts>
                       
                        <!-- put in my artifactory -->
                        <bootclasspathArtifact>
                            <groupId>test</groupId>
                            <artifactId>test</artifactId>
                            <version>1.0.0</version>
                        </bootclasspathArtifact>

                        <!-- put in my artifactory -->
                        <bootclasspathArtifact>
                          <groupId>sun.jdk</groupId>
                          <artifactId>tools</artifactId>
                          <version>1.6.0.16</version>
                        </bootclasspathArtifact>
                       
                        <!-- put in my artifactory -->
                        <bootclasspathArtifact>
                          <groupId>sun.jdk</groupId>
                          <artifactId>rt</artifactId>
                          <version>1.6.0.16</version>
                        </bootclasspathArtifact>
                       
                    </bootclasspathArtifacts>
But no luck.



There must be some way to tell maven where to find classes during it's executing or I'm misstaken?

Best regards
Fredrik
Avatar billede fredand Forsker
23. august 2010 - 21:23 #2
I close this one!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester