Skip to content
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

spotbugsTestCases is not compilable anymore in Eclipse #1316

Closed
iloveeclipse opened this issue Sep 29, 2020 · 1 comment
Closed

spotbugsTestCases is not compilable anymore in Eclipse #1316

iloveeclipse opened this issue Sep 29, 2020 · 1 comment
Assignees
Labels

Comments

@iloveeclipse
Copy link
Member

spotbugsTestCases project is not compilable anymore in Eclipse, because of Java 11 "modules" crap that doesn't allow to compile Java 11 code if the modulepath contain two "modules" that ship same package. In current case we have Java 11 SDK that has org.w3c.dom declared in java.xml package, and some other dependency:

The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml

If I manually disable two dependencies below from .classpath, "accessible from more than one module" errors disappear:

spotbugs-spotbugs
jaxen-1.1.6.jar

I have to grock who and how brings which dependency to the module path that has org.w3c.dom included.

@iloveeclipse iloveeclipse self-assigned this Sep 29, 2020
@iloveeclipse
Copy link
Member Author

iloveeclipse commented Sep 29, 2020

OK, looks like the problem is coming from the spotbugs dependency on dom4j that in turn optionally depends on jaxen.
In the 1.1.6 version of jaxen there is org.w3c.dom package defined. I think updating to 1.2.0 should fix the problem.

See https://www.mhonarc.org/archive/html/xsl-list/2019-04/msg00020.html

iloveeclipse added a commit that referenced this issue Sep 29, 2020
This partly fixes issue #1315 compilation error on test projects, so
that Eclipse can access spotbugs project too.

The remaining errors are related to the issue #1316, which is not that
trivial, so is coming in the next commit.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
iloveeclipse added a commit that referenced this issue Sep 29, 2020
This fixes issue #1316 and finally fixes issue #1315.

This change switches from Jaxen 1.1.6 to 1.2.0 to allow compilation of
the projects that rely on SpotBugs project with Java 11.

Jaxen is a transitive optional dependency of dom4j that we use in
SpotBugs.

Jaxen 1.1.6 ships org.w3c.dom package, which is also now shipped by JDK
in java.xml module. Java 9+ comiler disallow compilation if modules on
module path ship same package. So compilation of spotbugsTestCases with
Java 11 fails if the target release is 11 with the error: "The package
org.w3c.dom is accessible from more than one module: <unnamed>,
java.xml".

Solution is to update Jaxen to 1.2.0 version, that does not ship
org.w3c.dom package anymore.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
iloveeclipse added a commit that referenced this issue Sep 29, 2020
This fixes issue #1316 and finally fixes issue #1315.

This change switches from Jaxen 1.1.6 to 1.2.0 to allow compilation of
the projects that rely on SpotBugs project with Java 11.

Jaxen is a transitive optional dependency of dom4j that we use in
SpotBugs.

Jaxen 1.1.6 ships org.w3c.dom package, which is also now shipped by JDK
in java.xml module. Java 9+ comiler disallow compilation if modules on
module path ship same package. So compilation of spotbugsTestCases with
Java 11 fails if the target release is 11 with the error: "The package
org.w3c.dom is accessible from more than one module: <unnamed>,
java.xml".

Solution is to update Jaxen to 1.2.0 version, that does not ship
org.w3c.dom package anymore.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
iloveeclipse added a commit that referenced this issue Sep 29, 2020
This partly fixes issue #1315 compilation error on test projects, so
that Eclipse can access spotbugs project too.

The remaining errors are related to the issue #1316, which is not that
trivial, so is coming in the next commit.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
iloveeclipse added a commit that referenced this issue Sep 29, 2020
This fixes issue #1316 and finally fixes issue #1315.

This change switches from Jaxen 1.1.6 to 1.2.0 to allow compilation of
the projects that rely on SpotBugs project with Java 11.

Jaxen is a transitive optional dependency of dom4j that we use in
SpotBugs.

Jaxen 1.1.6 ships org.w3c.dom package, which is also now shipped by JDK
in java.xml module. Java 9+ comiler disallow compilation if modules on
module path ship same package. So compilation of spotbugsTestCases with
Java 11 fails if the target release is 11 with the error: "The package
org.w3c.dom is accessible from more than one module: <unnamed>,
java.xml".

Solution is to update Jaxen to 1.2.0 version, that does not ship
org.w3c.dom package anymore.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
iloveeclipse added a commit that referenced this issue Oct 6, 2020
This partly fixes issue #1315 compilation error on test projects, so
that Eclipse can access spotbugs project too.

The remaining errors are related to the issue #1316, which is not that
trivial, so is coming in the next commit.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
iloveeclipse added a commit that referenced this issue Oct 6, 2020
This fixes issue #1316 and finally fixes issue #1315.

This change switches from Jaxen 1.1.6 to 1.2.0 to allow compilation of
the projects that rely on SpotBugs project with Java 11.

Jaxen is a transitive optional dependency of dom4j that we use in
SpotBugs.

Jaxen 1.1.6 ships org.w3c.dom package, which is also now shipped by JDK
in java.xml module. Java 9+ comiler disallow compilation if modules on
module path ship same package. So compilation of spotbugsTestCases with
Java 11 fails if the target release is 11 with the error: "The package
org.w3c.dom is accessible from more than one module: <unnamed>,
java.xml".

Solution is to update Jaxen to 1.2.0 version, that does not ship
org.w3c.dom package anymore.

Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant