Try to get HAPI building on JDK9
This commit is contained in:
parent
b61887e841
commit
4af52c160f
|
@ -25,5 +25,5 @@ before_script:
|
||||||
script:
|
script:
|
||||||
# - mvn -e -B clean install && cd hapi-fhir-ra && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean test jacoco:report coveralls:report
|
# - mvn -e -B clean install && cd hapi-fhir-ra && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID clean test jacoco:report coveralls:report
|
||||||
# - mvn -Dci=true -e -B -P ALLMODULES,NOPARALLEL,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
|
# - mvn -Dci=true -e -B -P ALLMODULES,NOPARALLEL,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
|
||||||
- mvn -Dci=true -e -B -P ALLMODULES,REDUCED_JPA_TESTS,ERRORPRONE clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
|
- mvn -Dci=true -e -B -P ALLMODULES,REDUCED_JPA_TESTS,ERRORPRONE_JDK8 clean install && cd hapi-fhir-jacoco && mvn -e -B -DTRAVIS_JOB_ID=$TRAVIS_JOB_ID jacoco:report coveralls:report
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,4 @@ cache:
|
||||||
- C:\maven\
|
- C:\maven\
|
||||||
- C:\Users\appveyor\.m2\repository
|
- C:\Users\appveyor\.m2\repository
|
||||||
build_script:
|
build_script:
|
||||||
- cmd: mvn -P MINPARALLEL,ALLMODULES install
|
- cmd: mvn -P MINPARALLEL,ALLMODULES,ERRORPRONE_JDK8 install
|
||||||
|
|
|
@ -190,20 +190,22 @@
|
||||||
<groupId>com.phloc</groupId>
|
<groupId>com.phloc</groupId>
|
||||||
<artifactId>phloc-commons</artifactId>
|
<artifactId>phloc-commons</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
These have been added as explicit dependencies
|
||||||
|
as JDK9 no longer includes them by default
|
||||||
|
-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.xml.bind</groupId>
|
<groupId>javax.xml.bind</groupId>
|
||||||
<artifactId>jaxb-api</artifactId>
|
<artifactId>jaxb-api</artifactId>
|
||||||
<version>2.3.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.xml.bind</groupId>
|
<groupId>com.sun.xml.bind</groupId>
|
||||||
<artifactId>jaxb-core</artifactId>
|
<artifactId>jaxb-core</artifactId>
|
||||||
<version>2.3.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sun.xml.bind</groupId>
|
<groupId>com.sun.xml.bind</groupId>
|
||||||
<artifactId>jaxb-impl</artifactId>
|
<artifactId>jaxb-impl</artifactId>
|
||||||
<version>2.3.0</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -550,6 +550,27 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
<!--
|
||||||
|
These have been added as explicit dependencies
|
||||||
|
as JDK9 no longer includes them by default
|
||||||
|
-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-api</artifactId>
|
||||||
|
<version>${jaxb_api_version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-core</artifactId>
|
||||||
|
<version>${jaxb_core_version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-impl</artifactId>
|
||||||
|
<version>${jaxb_core_version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
|
|
|
@ -13,6 +13,9 @@ import ca.uhn.fhir.tinder.ValueSetGenerator;
|
||||||
import ca.uhn.fhir.tinder.VelocityHelper;
|
import ca.uhn.fhir.tinder.VelocityHelper;
|
||||||
import ca.uhn.fhir.tinder.model.*;
|
import ca.uhn.fhir.tinder.model.*;
|
||||||
import ca.uhn.fhir.tinder.model.SimpleSetter.Parameter;
|
import ca.uhn.fhir.tinder.model.SimpleSetter.Parameter;
|
||||||
|
import com.google.common.base.Charsets;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.commons.lang.WordUtils;
|
import org.apache.commons.lang.WordUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
@ -455,8 +458,8 @@ public abstract class BaseStructureParser {
|
||||||
scanForTypeNameConflicts(theNext, typeNames);
|
scanForTypeNameConflicts(theNext, typeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExtensions(ArrayList<Extension> theExts) {
|
public void setExtensions(ArrayList<Extension> theExtensions) {
|
||||||
myExtensions = theExts;
|
myExtensions = theExtensions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVelocityProperties(String theVelocityProperties) {
|
public void setVelocityProperties(String theVelocityProperties) {
|
||||||
|
@ -464,12 +467,7 @@ public abstract class BaseStructureParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void write(BaseRootType theResource, File theFile, String thePackageBase) throws IOException, MojoFailureException {
|
private void write(BaseRootType theResource, File theFile, String thePackageBase) throws IOException, MojoFailureException {
|
||||||
FileOutputStream fos = new FileOutputStream(theFile, false);
|
ArrayList<String> imports = new ArrayList<>();
|
||||||
OutputStreamWriter w = new OutputStreamWriter(fos, "UTF-8");
|
|
||||||
|
|
||||||
ourLog.debug("Writing file: {}", theFile.getAbsolutePath());
|
|
||||||
|
|
||||||
ArrayList<String> imports = new ArrayList<String>();
|
|
||||||
for (String next : myImports) {
|
for (String next : myImports) {
|
||||||
next = Resource.correctName(next);
|
next = Resource.correctName(next);
|
||||||
if (next.contains(".")) {
|
if (next.contains(".")) {
|
||||||
|
@ -535,10 +533,36 @@ public abstract class BaseStructureParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
InputStreamReader templateReader = new InputStreamReader(templateIs);
|
InputStreamReader templateReader = new InputStreamReader(templateIs);
|
||||||
v.evaluate(ctx, w, "", templateReader);
|
ByteArrayOutputStream byteArrayWriter = new ByteArrayOutputStream();
|
||||||
|
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayWriter, Charsets.UTF_8);
|
||||||
|
v.evaluate(ctx, outputStreamWriter, "", templateReader);
|
||||||
|
outputStreamWriter.flush();
|
||||||
|
|
||||||
w.close();
|
byte[] bytesToWrite = byteArrayWriter.toByteArray();
|
||||||
fos.close();
|
|
||||||
|
boolean actuallyWrite = false;
|
||||||
|
if (!theFile.exists()) {
|
||||||
|
actuallyWrite = true;
|
||||||
|
} else if (FileUtils.sizeOf(theFile) != bytesToWrite.length) {
|
||||||
|
actuallyWrite = true;
|
||||||
|
} else {
|
||||||
|
byte[] existingBytes = IOUtils.toByteArray(new FileInputStream(theFile));
|
||||||
|
if (!Arrays.equals(existingBytes, bytesToWrite)) {
|
||||||
|
actuallyWrite = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!actuallyWrite) {
|
||||||
|
ourLog.info("Skipping writing already up-to-date file: {}", theFile.getAbsolutePath());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ourLog.debug("Writing file: {}", theFile.getAbsolutePath());
|
||||||
|
|
||||||
|
try (FileOutputStream fos = new FileOutputStream(theFile, false)) {
|
||||||
|
fos.write(bytesToWrite);
|
||||||
|
fos.flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeAll(File theOutputDirectory, File theResourceOutputDirectory, String thePackageBase) throws MojoFailureException {
|
public void writeAll(File theOutputDirectory, File theResourceOutputDirectory, String thePackageBase) throws MojoFailureException {
|
||||||
|
|
47
pom.xml
47
pom.xml
|
@ -408,6 +408,8 @@
|
||||||
|
|
||||||
<!-- Dependency Versions -->
|
<!-- Dependency Versions -->
|
||||||
<derby_version>10.14.1.0</derby_version>
|
<derby_version>10.14.1.0</derby_version>
|
||||||
|
<jaxb_api_version>2.3.0</jaxb_api_version>
|
||||||
|
<jaxb_core_version>2.3.0</jaxb_core_version>
|
||||||
<jersey_version>2.25.1</jersey_version>
|
<jersey_version>2.25.1</jersey_version>
|
||||||
<jetty_version>9.4.8.v20171121</jetty_version>
|
<jetty_version>9.4.8.v20171121</jetty_version>
|
||||||
<!--<hibernate_version>5.2.10.Final</hibernate_version>-->
|
<!--<hibernate_version>5.2.10.Final</hibernate_version>-->
|
||||||
|
@ -580,11 +582,26 @@
|
||||||
<artifactId>javax.json-api</artifactId>
|
<artifactId>javax.json-api</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-api</artifactId>
|
||||||
|
<version>${jaxb_api_version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<version>2.8.1</version>
|
<version>2.8.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-core</artifactId>
|
||||||
|
<version>${jaxb_core_version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-impl</artifactId>
|
||||||
|
<version>${jaxb_core_version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.mail</groupId>
|
<groupId>javax.mail</groupId>
|
||||||
<artifactId>javax.mail-api</artifactId>
|
<artifactId>javax.mail-api</artifactId>
|
||||||
|
@ -1063,9 +1080,9 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>de.juplo</groupId>
|
<groupId>de.juplo</groupId>
|
||||||
<artifactId>hibernate-maven-plugin</artifactId>
|
<artifactId>hibernate-maven-plugin</artifactId>
|
||||||
<version>2.0.0</version>
|
<version>2.1.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<export>false</export>
|
<execute>false</execute>
|
||||||
<skip>false</skip>
|
<skip>false</skip>
|
||||||
<scanDependencies>false</scanDependencies>
|
<scanDependencies>false</scanDependencies>
|
||||||
<scanTestClasses>false</scanTestClasses>
|
<scanTestClasses>false</scanTestClasses>
|
||||||
|
@ -1972,10 +1989,7 @@
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>ERRORPRONE</id>
|
<id>ERRORPRONE_JDK8</id>
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -1988,6 +2002,27 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>ERRORPRONE_JDK9</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<compilerId>javac-with-errorprone</compilerId>
|
||||||
|
</configuration>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.errorprone</groupId>
|
||||||
|
<artifactId>error_prone_core</artifactId>
|
||||||
|
<version>2.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -93,6 +93,11 @@
|
||||||
not respect any chained method parameters (e.g. MedicationRequest?medication.code=123).
|
not respect any chained method parameters (e.g. MedicationRequest?medication.code=123).
|
||||||
Thanks to @manjusampath for reporting!
|
Thanks to @manjusampath for reporting!
|
||||||
</action>
|
</action>
|
||||||
|
<action type="fix">
|
||||||
|
A few fixes went into the build which should now allow HAPI FHIR
|
||||||
|
to build correctly on JDK 9.0. Currently building is supported on
|
||||||
|
JDK 8.x and 9.x only.
|
||||||
|
</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="3.2.0" date="2018-01-13">
|
<release version="3.2.0" date="2018-01-13">
|
||||||
<action type="add">
|
<action type="add">
|
||||||
|
|
Loading…
Reference in New Issue