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

2.10 - JAXB to JPMS #81

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion jaxb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,21 @@ data-binding.
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2</version>
<version>2.3.1</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.jwebmp.thirdparty</groupId>
<artifactId>javax.activation</artifactId>
<version>0.67.0.5</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -52,4 +64,40 @@ data-binding.
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>java8</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<executions>
<execution>
<id>add-module-infos</id>
<phase>package</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<overwriteExistingFiles>true</overwriteExistingFiles>
<module>
<moduleInfoFile>
src/java9/module-info.java
</moduleInfoFile>
</module>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>


</project>
11 changes: 11 additions & 0 deletions jaxb/src/java9/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module com.fasterxml.jackson.module.jaxb {
requires com.fasterxml.jackson.databind;
requires java.activation;
requires java.xml;
requires java.xml.bind;
requires java.desktop;

exports com.fasterxml.jackson.module.jaxb;

provides com.fasterxml.jackson.databind.Module with com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.json.PackageVersion;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, no, that would bring wrong PackageVersion -- probably brought in by IDE accidental. This is auto-generated from template as part of build process.

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.cfg.MapperConfig;
import com.fasterxml.jackson.databind.introspect.*;
Expand Down Expand Up @@ -1346,6 +1347,7 @@ private PropertyName findJaxbPropertyName(Annotated ae, Class<?> aeType, String
return _combineNames(name, rootElement.namespace(), defaultName);
}
// Is there a namespace there to use? Probably not?
// @TODO Introspector removal - jdk.desktop module
return new PropertyName(Introspector.decapitalize(aeType.getSimpleName()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.core.json.PackageVersion;

/**
* Module that can be registered to add support for JAXB annotations.
Expand All @@ -15,7 +15,7 @@
* (by default, JAXB annotations are used as {@link Priority#PRIMARY}
* annotations).
*/
public class JaxbAnnotationModule extends Module
public class JaxbAnnotationModule extends com.fasterxml.jackson.databind.Module
{
/**
* Enumeration that defines how we use JAXB Annotations: either
Expand Down
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,19 @@ not datatype, data format, or JAX-RS provider modules.
</pluginManagement>
</build>

<profiles>
<profile>
<id>java9</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<jdk.version>1.12</jdk.version>
<maven.compiler.source>1.12</maven.compiler.source>
<maven.compiler.target>1.12</maven.compiler.target>
<maven.compiler.release>12</maven.compiler.release>
</properties>
</profile>
</profiles>

</project>