Skip to content

Commit

Permalink
Java 11 migration: quick and dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
pskopek committed Dec 27, 2018
1 parent b8ad3e2 commit d8cd59d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 11 deletions.
46 changes: 38 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<version>0.1.0-SNAPSHOT</version>
<name>Fishing Contest</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version>
<eclipse.version>4.3</eclipse.version>
<opt>${user.home}/opt</opt>
<eclipse.home>${opt}/eclipse/kepler</eclipse.home>
<eclipse.plugins>${eclipse.home}/plugins</eclipse.plugins>

<!-- maven-compiler-plugin -->
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -128,20 +129,49 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<compilerArguments>
<bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>[11,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
<!-- compilerArguments>
<bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
</compilerArguments -->
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/fc/data/Contest.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ public void dumpToFile(String fileName) throws XMLStreamException, FileNotFoundE

XMLOutputFactory xmlof = XMLOutputFactory.newInstance();

// TODO: find new way of indenting xml stream writer
// XMLStreamWriter xmlw = new com.sun.xml.internal.txw2.output.IndentingXMLStreamWriter(
// xmlof.createXMLStreamWriter(new FileOutputStream(fileName)));

XMLStreamWriter xmlw = new com.sun.xml.internal.txw2.output.IndentingXMLStreamWriter(
xmlof.createXMLStreamWriter(new FileOutputStream(fileName)));

XMLStreamWriter xmlw = xmlof.createXMLStreamWriter(new FileOutputStream(fileName));

xmlw.writeStartDocument();
xmlw.writeStartElement("contest");
Expand Down

0 comments on commit d8cd59d

Please sign in to comment.