diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ae15511..c89230f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,9 +17,78 @@ on: - 'README*' jobs: - build: + build-linux: runs-on: ubuntu-latest - name: build with JDK 11 + name: build with JDK 11 (Linux) + + steps: + - uses: actions/checkout@v2 + name: checkout + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 11 + with: + version: 11 + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 10 + with: + version: 10 + targets: 'JAVA_HOME_10' + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 9 + with: + version: 9 + targets: 'JAVA_HOME_9' + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 8 + with: + version: 8 + targets: 'JAVA_HOME_8' + + - name: build with maven + run: mvn -B formatter:validate verify --file pom.xml -Djava8.home=$JAVA_HOME_8 -Djava9.home=$JAVA_HOME_9 -Djava10.home=$JAVA_HOME_10 + + build-windows: + runs-on: windows-latest + name: build with JDK 11 (Windows) + + steps: + - uses: actions/checkout@v2 + name: checkout + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 11 + with: + version: 11 + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 10 + with: + version: 10 + targets: 'JAVA_HOME_10' + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 9 + with: + version: 9 + targets: 'JAVA_HOME_9' + + - uses: AdoptOpenJDK/install-jdk@v1 + name: set up JDK 8 + with: + version: 8 + targets: 'JAVA_HOME_8' + + - name: build with maven + shell: bash + run: mvn -B formatter:validate verify --file pom.xml -Djava8.home=$JAVA_HOME_8 -Djava9.home=$JAVA_HOME_9 -Djava10.home=$JAVA_HOME_10 + + build-macos: + runs-on: macos-latest + name: build with JDK 11 (Mac OS) steps: - uses: actions/checkout@v2 @@ -52,7 +121,7 @@ jobs: run: mvn -B formatter:validate verify --file pom.xml -Djava8.home=$JAVA_HOME_8 -Djava9.home=$JAVA_HOME_9 -Djava10.home=$JAVA_HOME_10 quality: - needs: [build] + needs: [build-linux,build-macos,build-windows] if: github.event_name == 'push' && github.repository == 'smallrye/smallrye-common' runs-on: ubuntu-latest name: quality diff --git a/classloader/src/test/java/io/smallrye/common/classloader/ClassPathUtilsTest.java b/classloader/src/test/java/io/smallrye/common/classloader/ClassPathUtilsTest.java index 2efa221e..28facb0e 100644 --- a/classloader/src/test/java/io/smallrye/common/classloader/ClassPathUtilsTest.java +++ b/classloader/src/test/java/io/smallrye/common/classloader/ClassPathUtilsTest.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.InputStreamReader; +import java.net.URI; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; @@ -79,8 +80,8 @@ void processAsPath(@TempDir Path tempDir) throws Exception { Path filePath = tempDir.resolve("resources.jar"); jar.as(ZipExporter.class).exportTo(filePath.toFile()); - URL resource = new URL("jar:file:" + filePath.toString() + "!/resources.properties"); - Properties properties = ClassPathUtils.processAsPath(resource, path -> { + URI resource = new URI("jar", filePath.toUri().toASCIIString() + "!/resources.properties", null); + Properties properties = ClassPathUtils.processAsPath(resource.toURL(), path -> { Properties properties1 = new Properties(); try (InputStreamReader reader = new InputStreamReader(Files.newInputStream(path))) { properties1.load(reader); @@ -102,8 +103,8 @@ void readStream(@TempDir Path tempDir) throws Exception { Path filePath = tempDir.resolve("resources.jar"); jar.as(ZipExporter.class).exportTo(filePath.toFile()); - URL resource = new URL("jar:file:" + filePath.toString() + "!/resources.properties"); - Properties properties = ClassPathUtils.readStream(resource, inputStream -> { + URI resource = new URI("jar", filePath.toUri().toASCIIString() + "!/resources.properties", null); + Properties properties = ClassPathUtils.readStream(resource.toURL(), inputStream -> { Properties properties1 = new Properties(); try (InputStreamReader reader = new InputStreamReader(inputStream)) { properties1.load(reader);