Skip to content

Commit

Permalink
Renamed Java9 artifact to Java11.
Browse files Browse the repository at this point in the history
  • Loading branch information
cowwoc committed May 5, 2020
1 parent aaf4d3a commit d9ee5fa
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 40 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ before_script:

script:
- export JDK8_HOME=$(jdk_switcher home oraclejdk8)
- export JDK9_HOME=/usr/lib/jvm/java-9-oracle
- test -d "${JDK9_HOME}" || export JDK9_HOME=$(jdk_switcher home oraclejdk8)
- export JDK11_HOME=/usr/lib/jvm/java-11-oracle
- test -d "${JDK11_HOME}" || export JDK11_HOME=$(jdk_switcher home oraclejdk8)

before_cache:
# No sense in caching current build artifacts
Expand All @@ -24,10 +24,9 @@ matrix:
fast_finish: true
include:
- jdk: oraclejdk8
- jdk: oraclejdk9
env:
- JDK=9
- jdk: oraclejdk11
env:
- JDK=11

install: /bin/true

Expand Down
80 changes: 54 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sureFireOptions9 />
<sureFireForks9>false</sureFireForks9>
<java9.sourceDirectory>${project.basedir}/src/main/java9</java9.sourceDirectory>
<java9.build.outputDirectory>${project.build.directory}/classes-java9</java9.build.outputDirectory>
<artifact.classifier />
<sureFireOptions11/>
<sureFireForks11>false</sureFireForks11>
<java11.sourceDirectory>${project.basedir}/src/main/java11</java11.sourceDirectory>
<java11.build.outputDirectory>${project.build.directory}/classes-java11</java11.build.outputDirectory>
<artifact.classifier/>

<docker.maven.plugin.fabric8.version>0.33.0</docker.maven.plugin.fabric8.version>
<felix.bundle.plugin.version>4.1.0</felix.bundle.plugin.version>
<felix.bundle.plugin.version>4.2.1</felix.bundle.plugin.version>
<felix.version>6.0.1</felix.version>
<hibernate.version>5.2.10.Final</hibernate.version>
<javassist.version>3.24.1-GA</javassist.version>
Expand Down Expand Up @@ -72,10 +73,6 @@
<version>9</version>
</parent>

<prerequisites>
<maven>3.3.9</maven>
</prerequisites>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -246,6 +243,27 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.3.9</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<!-- Generate proxies -->
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -376,7 +394,7 @@
<configuration>
<classifier>${artifact.classifier}</classifier>
<instructions>
<Automatic-Module-Name>com.zaxxer.hikari</Automatic-Module-Name>
<Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
<Multi-Release>true</Multi-Release>
<Bundle-Name>HikariCP</Bundle-Name>
<Export-Package>
Expand Down Expand Up @@ -452,10 +470,10 @@
<version>2.22.1</version>
<configuration>
<!-- Sets the VM argument line used when unit tests are run. -->
<argLine>${surefireArgLine} ${sureFireOptions9}</argLine>
<argLine>${surefireArgLine} ${sureFireOptions11}</argLine>
<!-- Skips unit tests if the value of skip.unit.tests property is true -->
<skipTests>${skip.unit.tests}</skipTests>
<reuseForks>${sureFireForks9}</reuseForks>
<reuseForks>${sureFireForks11}</reuseForks>
</configuration>
</plugin>

Expand Down Expand Up @@ -504,19 +522,28 @@

<profiles>
<profile>
<id>Java9</id>
<id>Java8</id>
<activation>
<jdk>[,11)</jdk>
</activation>
<properties>
<automatic.module.name>com.zaxxer.hikari</automatic.module.name>
</properties>
</profile>
<profile>
<id>Java11</id>
<activation>
<jdk>[9,)</jdk>
<jdk>[11,)</jdk>
</activation>
<properties>
<!-- sureFireOptions9>
<!-- sureFireOptions11>
-add-opens java.base/java.net=ALL-UNNAMED
-add-opens java.base/java.security=ALL-UNNAMED
-add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED
-add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED
</sureFireOptions9 -->
<sureFireForks9>true</sureFireForks9>
<artifact.classifier>java9</artifact.classifier>
</sureFireOptions11 -->
<sureFireForks11>true</sureFireForks11>
<artifact.classifier>java11</artifact.classifier>
</properties>

<build>
Expand All @@ -526,18 +553,18 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>compile-java9</id>
<id>compile-java11</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir="${java9.build.outputDirectory}"/>
<copy todir="${java9.build.outputDirectory}">
<mkdir dir="${java11.build.outputDirectory}"/>
<copy todir="${java11.build.outputDirectory}">
<fileset dir="${project.build.outputDirectory}"/>
</copy>
<javac srcdir="${java9.sourceDirectory}" destdir="${java9.build.outputDirectory}"
<javac srcdir="${java11.sourceDirectory}" destdir="${java11.build.outputDirectory}"
classpath="${project.build.outputDirectory}" includeantruntime="false"/>
</tasks>
</configuration>
Expand All @@ -548,6 +575,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-module-info</id>
Expand All @@ -556,10 +584,10 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/9</outputDirectory>
<outputDirectory>${project.build.outputDirectory}/META-INF/versions/11</outputDirectory>
<resources>
<resource>
<directory>${java9.build.outputDirectory}</directory>
<directory>${java11.build.outputDirectory}</directory>
<includes>
<include>module-info.class</include>
</includes>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/test/java/com/zaxxer/hikari/osgi/OSGiBundleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import javax.inject.Inject;
import java.io.File;

import static com.zaxxer.hikari.pool.TestElf.isJava9;
import static com.zaxxer.hikari.pool.TestElf.isJava11;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.*;
Expand Down Expand Up @@ -96,14 +96,14 @@ public ConditionalPaxExam(Class<?> klass) throws InitializationError {

@Override
public void run(RunNotifier notifier) {
if (!isJava9()) {
if (!isJava11()) {
super.run(notifier);
}
}

@Override
public void filter(Filter filter) throws NoTestsRemainException {
if (isJava9()) {
if (isJava11()) {
throw new NoTestsRemainException();
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/zaxxer/hikari/pool/TestElf.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ private TestElf() {
// default constructor
}

public static boolean isJava9() {
return System.getProperty("java.version").startsWith("9");
public static boolean isJava11() {
return System.getProperty("java.version").startsWith("11");
}

public static HikariPool getPool(final HikariDataSource ds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.zaxxer.hikari.util;

import com.zaxxer.hikari.pool.TestElf;
import com.zaxxer.hikari.pool.TestElf.FauxWebClassLoader;
import com.zaxxer.hikari.util.ConcurrentBag.IConcurrentBagEntry;
import org.junit.FixMethodOrder;
Expand All @@ -33,7 +32,7 @@
import java.util.Iterator;
import java.util.concurrent.CompletableFuture;

import static com.zaxxer.hikari.pool.TestElf.isJava9;
import static com.zaxxer.hikari.pool.TestElf.isJava11;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
Expand All @@ -48,7 +47,7 @@ public class TomcatConcurrentBagLeakTest
@Test
public void testConcurrentBagForLeaks() throws Exception
{
assumeTrue(!isJava9());
assumeTrue(!isJava11());

ClassLoader cl = new FauxWebClassLoader();
Class<?> clazz = cl.loadClass(this.getClass().getName() + "$FauxWebContext");
Expand All @@ -65,7 +64,7 @@ public void testConcurrentBagForLeaks() throws Exception
@Test
public void testConcurrentBagForLeaks2() throws Exception
{
assumeTrue(!isJava9());
assumeTrue(!isJava11());

ClassLoader cl = this.getClass().getClassLoader();
Class<?> clazz = cl.loadClass(this.getClass().getName() + "$FauxWebContext");
Expand Down

0 comments on commit d9ee5fa

Please sign in to comment.