-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Attempting to build model of Dubbo (3.1.1) #4952
Comments
This is indeed a problem because Spoon tries to build the model from all files at once. Spoon has no concept of multi-modules in its hierarchy, so having two classes with the same FQN will cause issues. As an example, both https://github.com/apache/dubbo/blob/a66f5126745858f393c67c15d9a84f9e60405aba/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-consumer/src/main/java/org/apache/dubbo/demo/consumer/Application.java and https://github.com/apache/dubbo/blob/a66f5126745858f393c67c15d9a84f9e60405aba/dubbo-demo/dubbo-demo-api/dubbo-demo-api-consumer/src/main/java/org/apache/dubbo/demo/consumer/Application.java are in the same package and have the same simple name. Therefore, whenever asking for For this to work, you would currently need mutliple Launchers. Or probably it's enough to exclude the demo modules in your case? Note there is also https://spoon.gforge.inria.fr/mvnsites/spoon-core/apidocs/spoon/compiler/Environment.html#setIgnoreDuplicateDeclarations(boolean). This might make the error go away, but it will probably also break other things. |
Hello, I do not understand as the documentation states:
(https://spoon.gforge.inria.fr/launcher.html) Sincerely, |
I may be mistaken, the documentation talks about Maven modules, not Jigsaw modules? This bug seems related to #4751. |
Yes, the issue here is the vague usage of "handles multi-module Maven projects". What that (currently) actually means it can find all the modules, it can find the dependencies of all the modules, but all the modules are on the source classpath for JDT, so JDT will try to compile all at once. I assume this can't be simply fixed in a non-breaking way in the current MavenLauncher,
Yes, the documentation of the MavenLauncher talks about Maven modules. The given project also doesn't seem to be based on Jigsaw modules, so that shouldn't be an issue here. |
Describe the bug
I try to analyze Dubbo source code, but Spoon throws a ModelBuildingException. Shall I use Spoon to analyze such multi-pom.xml projects? Or I need to set some properties of maven laucher?
Source code you are trying to analyze/transform
Source code for your Spoon processing
Actual output
Expected output
Spoon Version
10.1.1
JVM Version
11
What operating system are you using?
Ubuntu 20.04.3 LTS
The text was updated successfully, but these errors were encountered: