Crawling project with module-info.java fails
Closed this issue · 4 comments
kaklakariada commented
Crawling a project with a module-info.java
file fails with the following error message:
[ERROR] Failed to execute goal com.exasol:error-code-crawler-maven-plugin:1.2.2:verify (default-cli)
on project small-json-files-test-fixture:
Execution default-cli of goal com.exasol:error-code-crawler-maven-plugin:1.2.2:verify failed:
Ambiguous package name detected.
If you believe the code you analyzed is correct, please file an issue
and reference https://github.com/INRIA/spoon/issues/4051.
Error details: Found 2 non-empty packages with name 'com.exasol.smalljsonfilesfixture'
The issue seems to be caused by the test code because deleting all test classes results in a different error message:
Execution default-cli of goal com.exasol:error-code-crawler-maven-plugin:1.2.1:verify failed: jakarta.json cannot be resolved to a module at $HOME/git/small-json-files-test-fixture/src/main/java/module-info.java:7
Workaround
Exclude tests from crawling:
<plugin>
<groupId>com.exasol</groupId>
<artifactId>error-code-crawler-maven-plugin</artifactId>
<configuration>
<sourcePaths>src/main/java</sourcePaths>
</configuration>
</plugin>
Example projects:
kaklakariada commented
A possible solution could be using the MavenLauncher, see https://spoon.gforge.inria.fr/launcher.html
ckunki commented
Proposal: Close ticket as "won't fix".
Rationale:
- Exasol integration team usually delivers fat jars (e.g. adapters, or executable jars like bucketfs client) which do not benefit from Java-9 modules.
kaklakariada commented
Using MavenLauncher is not possible because it does not allow configuring a custom source path and always uses the default Maven source folders.
kaklakariada commented
Please note that module resolution still fails. This must be solved upstream in Spoon: INRIA/spoon#5324