Open rmpestano opened 7 years ago
Thanks for issuing this. Actually that error was introduced in the last version, I'm wondering why I dind't find it earlier...
@rmpestano @wumpz: Could you please retry with the latest 0.14-SNAPSHOT
version from the Maven central snapshot repositories?
The error has to do with the tools.jar, that is loaded into the class path since the JavaDoc analysis. Somehow the Java compiler get's confused with that. Changed the Maven plugin phase to process-test-classes
so that it runs after the test compilation.
:+1:
Could not test your actual 14.0-SNAPSHOT, but forcing the plugin to run in phase process-test-classes
did the trick.
<plugin>
<groupId>com.sebastian-daschner</groupId>
<artifactId>jaxrs-analyzer-maven-plugin</artifactId>
<version>0.13</version>
<executions>
<execution>
<phase>process-test-classes</phase>
<goals><goal>analyze-jaxrs</goal></goals>
<configuration>
<backend>swagger</backend>
</configuration>
</execution>
</executions>
</plugin>
Great!
Yes, you would temporarily need the Maven Central Snapshot repositories:
<pluginRepositories>
<pluginRepository>
<id>ossrh-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Since that version is (more or less) broken, I'm just about to release 0.14
.
Thanks a lot for testing!
Unfortunately this will not work in multimodule maven projects. The issue is only defered to the next module. So no solution yet. Please reopen this issue.
Hmm... So somehow the tools.jar
dependency leads to confusion of the compiles (test) classes which doesn't make any sense to me. @rmpestano any ideas?
Unfortunately the whole JavaDoc processing introduced a lot of instabilities, the way the Parser-"API" is called is just very unfortunate :-( AFAIK there is no easy alternative for JavaDoc comment parsing...
Hi guys, I also don't know the javadoc internals, have you looked into swagger doclet for some inspiration?
Yeah, they use just a "normal" Doclet, run with maven-javadoc-plugin, but we need to run is as part of the Analyzer... I was even thinking about writing an own (small) JavaDoc parser, at this point -- with all the introduced error -- that might even be simpler...
Looks like JavaParser library can do some javadoc (and comments) parsing, see here: https://github.com/javaparser/javaparser/issues/325
Maybe it helps
Yes, I guess that's is a viable option...
Funnily one of my first attempts when I started the Analysis algorithm was to parse the AST from the code, but then I switched to Bytecode analysis for a couple of reasons. Now partially back (for JavaDocs) :-)
So will there be a solution in v15?
I also have this compilation problem.
I found that removing the call to addToSystemClassLoader(lib) in ProjectAnalyzer constructor solves this for me.
@spartan2015 would you mind opening a PR? @sdaschner are you still mainting this?
done
2a293a900ee2ab4cd0a533fcd7f68962d84735a7 added better JavaDoc parsing using the JavaParser (thanks @rmpestano for the hint!). This now removed the tools.jar
and it's unstable dependency-tinkering. Please test with the 0.17-SNAPSHOT
version (Maven's staging repositories needed for that). Will publish that afterwards.
I had the same compilation problem in a multi-module project. Switching to 0.17-SNAPSHOT
solved it.
Hi guys,
I am getting an error in test compilation (maven) phase when I use JaxRS Analyzer. The error is:
It looks like the byte code or javadoc analysis made test classes in an inconsistent state.
If I execute JaxRS analisys after test compilation then I got no error:
Also if I delete test classes I got no error ;)
Here is a simple maven project which reproduces the error, just do a clean package:
cdi-crud.zip