-
Notifications
You must be signed in to change notification settings - Fork 77
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
Jakarta Namespace Support #116
Changes from 3 commits
c86bf3f
97819b3
bf95cb3
85b4dca
a76ab3f
187163e
db8563f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,40 @@ data-binding. | |
<plugin> | ||
<groupId>org.moditect</groupId> | ||
<artifactId>moditect-maven-plugin</artifactId> | ||
<inherited>true</inherited> | ||
<configuration> | ||
<jvmVersion>11</jvmVersion> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>jakarta</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<shadedArtifactAttached>true</shadedArtifactAttached> | ||
<shadedClassifierName>jakarta</shadedClassifierName> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
<artifactSet> | ||
<includes> | ||
<include>com.fasterxml.jackson.module:jackson-module-jaxb-annotations</include> | ||
</includes> | ||
</artifactSet> | ||
<relocations> | ||
<relocation> | ||
<pattern>javax.xml.bind</pattern> | ||
<shadedPattern>jakarta.xml.bind</shadedPattern> | ||
</relocation> | ||
</relocations> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so does this create additional second jar, with different classifier, in addition to "vanilla" one? But even then, from what I remember wrt OSGi, there is always backlash on adding shaded secondary components, when they overlap with other artifacts (that is, classes also provided by a standalone package). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok n/m. Cloned branch, looked at what is produced. So it is not shading in activation jar classes or anything so that's fine. I assume it renames references somewhere... in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The relocation on the shade is doing a transform on the .class files just renaming javax. to jakarta. :) There shouldn't be any clash with OSGi - the bundle plugin looks to do quite a good job, but no files other than meta-inf/services and .class files are altered during the shade :) |
||
</plugin> | ||
</plugins> | ||
</build> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module com.fasterxml.jackson.module.jaxb { | ||
requires java.logging; | ||
requires java.xml; | ||
requires java.xml.bind; | ||
|
||
// Needed for JDK9+, but optionally only | ||
requires static java.activation; | ||
// Jakarta Release | ||
requires static jakarta.activation; | ||
|
||
requires com.fasterxml.jackson.core; | ||
requires com.fasterxml.jackson.databind; | ||
|
||
// expose main level, but leave out "ser", "deser" impl | ||
exports com.fasterxml.jackson.module.jaxb; | ||
|
||
provides com.fasterxml.jackson.databind.Module with | ||
com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this solves the javassist and jaxen issues in older jdk 7 frameworks reading module-info files, as well as doesn't get removed during the shade for jakarta namespacing
this was the trick to make it all work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about JDKs 9 and 10? They are not LTS versions but just in case...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is always that one person so it definitely is safer -
I double checked - for me I put it there as other modules override at 11, and i needed to overwrite those xD So no issue there will update