Skip to content

Commit

Permalink
Makes build work with JDK 10 (openzipkin#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancole authored Aug 6, 2018
1 parent ef0b0a5 commit e390609
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
# Quiet Maven invoker logs (Downloading... when running zipkin-server/src/it)
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
docker:
# Use java 9 here and 1.8 in travis (so that we test both)
- image: circleci/openjdk:9-jdk
# Use java 10 here and 1.8 in travis (so that we test both)
- image: circleci/openjdk:10-jdk
steps:
- checkout

Expand Down
2 changes: 1 addition & 1 deletion .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class MavenWrapperDownloader {
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar";
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
Expand Down
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
54 changes: 34 additions & 20 deletions benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<main.basedir>${project.basedir}/..</main.basedir>
<main.java.version>1.8</main.java.version>
<main.signature.artifact>java18</main.signature.artifact>
<jmh.version>1.20</jmh.version>
<jmh.version>1.21</jmh.version>
<protobuf.version>3.5.1</protobuf.version>
</properties>

Expand Down Expand Up @@ -88,25 +88,6 @@
</extension>
</extensions>
<plugins>
<plugin>
<inherited>true</inherited>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<!-- Disable errorprone because JMH generated classes don't add a generated annotation -->
<compilerArgs>
<arg>-XepDisableAllChecks</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
<!-- disable retrolambda as we allow language level 1.8 benchmark classes -->
<plugin>
<groupId>net.orfjackal.retrolambda</groupId>
Expand Down Expand Up @@ -181,4 +162,37 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- disable errorprone on JMH source tree -->
<id>error-prone-off</id>
<activation>
<!-- error-prone isn't happy in jdk 10 yet https://github.com/google/error-prone/issues/860#issuecomment-396154710 -->
<jdk>[1.8,10)</jdk>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<compilerArgs>
<arg>-XepDisableAllChecks</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
Expand Down
2 changes: 1 addition & 1 deletion mvnw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar"
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
Expand Down
141 changes: 77 additions & 64 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,24 @@
from other projects. For example, cassandra and spring boot set guava versions -->
<guava.version>19.0</guava.version>
<junit.version>4.12</junit.version>
<!-- to match powermock and spring testing -->
<mockito.version>1.10.19</mockito.version>
<powermock.version>2.0.0-beta.5</powermock.version>
<assertj.version>3.9.1</assertj.version>
<mockito.version>2.21.0</mockito.version>
<assertj.version>3.10.0</assertj.version>
<hamcrest.version>1.3</hamcrest.version>
<testcontainers.version>1.8.0</testcontainers.version>

<animal-sniffer-maven-plugin.version>1.16</animal-sniffer-maven-plugin.version>
<animal-sniffer-maven-plugin.version>1.17</animal-sniffer-maven-plugin.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-shade-plugin.version>3.1.0</maven-shade-plugin.version>
<maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M1</maven-enforcer-plugin.version>

<!-- Catch common Java mistakes as compile-time errors -->
<plexus-compiler-javac-errorprone.version>2.8.4</plexus-compiler-javac-errorprone.version>
<errorprone.version>2.3.1</errorprone.version>
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<maven-failsafe-plugin.version>2.22.0</maven-failsafe-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
</properties>

<name>Zipkin (Parent)</name>
Expand Down Expand Up @@ -354,6 +349,12 @@
<version>${assertj.version}</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand Down Expand Up @@ -415,11 +416,25 @@
<build>
<pluginManagement>
<plugins>
<!-- mvn -N io.takari:maven:wrapper -Dmaven=3.5.3 -->
<!-- mvn -N io.takari:maven:wrapper -Dmaven=3.5.4 -->
<plugin>
<groupId>io.takari</groupId>
<artifactId>maven</artifactId>
<version>0.6.0</version>
<version>0.6.1</version>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<inherited>true</inherited>
<configuration>
<!-- Retrolambda will rewrite lambdas as Java 6 bytecode -->
<source>1.8</source>
<target>1.8</target>
<!-- or die! com.sun.tools.javac.api.JavacTool -->
<fork>true</fork>
<showWarnings>true</showWarnings>
</configuration>
</plugin>

<plugin>
Expand All @@ -438,11 +453,6 @@
</configuration>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
Expand Down Expand Up @@ -511,7 +521,7 @@
<plugin>
<groupId>net.orfjackal.retrolambda</groupId>
<artifactId>retrolambda-maven-plugin</artifactId>
<version>2.5.3</version>
<version>2.5.4</version>
<executions>
<execution>
<goals>
Expand All @@ -529,48 +539,6 @@
</pluginManagement>

<plugins>
<plugin>
<inherited>true</inherited>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<!-- Retrolambda will rewrite lambdas as Java 6 bytecode -->
<source>1.8</source>
<target>1.8</target>
<!-- or die! com.sun.tools.javac.api.JavacTool -->
<fork>true</fork>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<!-- only use errorprone on main source tree -->
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-XepDisableWarningsInGeneratedCode</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>${plexus-compiler-javac-errorprone.version}</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>${errorprone.version}</version>
</dependency>
</dependencies>
</plugin>

<!-- Explicitly disable when using java version 1.8+ or not using java -->
<plugin>
<groupId>net.orfjackal.retrolambda</groupId>
Expand Down Expand Up @@ -717,7 +685,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>[1.8,10)</version>
<version>[1.8,11)</version>
</requireJavaVersion>
</rules>
</configuration>
Expand All @@ -728,6 +696,51 @@
</build>

<profiles>
<profile>
<id>error-prone</id>
<activation>
<!-- error-prone isn't happy in jdk 10 yet https://github.com/google/error-prone/issues/860#issuecomment-396154710 -->
<jdk>[1.8,10)</jdk>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<!-- only use errorprone on main source tree -->
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<!-- error-prone doesn't like generated code -->
<compilerArgs>
<arg>-XepDisableWarningsInGeneratedCode</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
Expand Down

0 comments on commit e390609

Please sign in to comment.