-
Notifications
You must be signed in to change notification settings - Fork 154
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
Java 11 and inclusion of dependencies in release jar #622
Comments
We could disable the assembly for JDK11.. thoughts? I already have in other places the --illegal-access work around (otherwise Surefire tests break too)
|
In general my experience is there has been little improvement since JDK 8 which is why I still tend use that. Jigsaw/modules kind of just get in the way with existing projects. However it should at least build/work. |
Wait I'm confused, is this a build error in your project? We currently don't have any errors on JDK 8, 11, or 13 |
@johnmay - Yes, the redundant inclusion of system library packages in the CDK release jars is causing a build error in my project when built with Java 11. |
Is it just
|
Here is the full dependency tree, I can't workout where it's coming from...
It's coming from |
@johnmay, there is 20 years of legacy here. CDK was around when Java did not have XML parsing functionality, and all we had was Xerces. I think have a look at this, if you like. |
Nah it's okay... I think we just don't need to xml-apis. Or we don't need it on newer JDK which we can tweak via Maven. |
the following patch does not give compile errors here: diff --git a/base/dict/pom.xml b/base/dict/pom.xml
index 4a40b977c5..4943c9c6e7 100644
--- a/base/dict/pom.xml
+++ b/base/dict/pom.xml
@@ -19,11 +19,6 @@
<artifactId>xom</artifactId>
<version>1.3.2</version>
</dependency>
- <dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.3.03</version>
- </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId> |
No. That's just one example compilation error. If I understand correctly, the inclusion of dependencies in the release jar will cause compilation errors whenever those dependencies includes packages that are visible from more than one module. The classpath is an unnamed module. I ran into it first with org.w3c.dom, because it was both in a Java system library module and on the classpath from the CDK. I think the same problem could happen with org.xml.sax. And it could happen with Guava and the Apache libraries if they were distributed or put into modules. That may be a likely future. Candidate solutions include:
|
The release.jar is primarily for users who don't have a proper build system... and just need something quick to get up and running. We mainly recommend pulling in the library from Maven central using Maven/Gradle/Ant+Ivy in which case this is a non-issue. How are you building your project? |
I'm using ant. But I think the problem I'm encountering will also be encountered by others trying to both use the release jar and Java 11. |
You should use Ivy and pull in |
Java 11 compilation fails if the same package is visible from more than one module.
The CDK release jars include dependencies whose packages may also be visible from other modules. Before Java 11, this was a nice convenience. Now, if I understand correctly, it seems harmful.
As an example, the packge org.w3c.dom is included in both the JRE system library and the CDK. This leads to the following compilation error:
The text was updated successfully, but these errors were encountered: