From e11bdef4f9c522b7078c2916f41aa3dbcfa23598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Op=C3=A1lka?= Date: Fri, 23 Jun 2023 12:47:49 +0200 Subject: [PATCH 1/6] Upgrade dependencies to latest version plus require JDK11+ since now on --- pom.xml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 805c6892..caaa69b4 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.jboss jboss-parent - 36 + 39 4.0.0 @@ -61,10 +61,13 @@ - 3.4.1.Final - 2.2.0.Final + 3.4.3.Final + 2.2.1.Final 1.2.0.Final 4.13.1 + 11 + 11 + 11 @@ -115,31 +118,35 @@ - - + org.jboss.logging jboss-logging ${version.org.jboss.logging.jboss-logging} compile - org.jboss.logging jboss-logging-annotations ${version.org.jboss.logging.jboss-logging-tools} provided - org.jboss.logging jboss-logging-processor ${version.org.jboss.logging.jboss-logging-tools} provided + + + junit + junit + ${version.junit} + test + org.jboss.test jboss-test @@ -176,12 +183,6 @@ - - junit - junit - ${version.junit} - test - From cf9f46ad289048007ed694fcc8788b215963c77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Op=C3=A1lka?= Date: Fri, 23 Jun 2023 13:01:54 +0200 Subject: [PATCH 2/6] [JBVFS-217] File protocol is not overrideable protocol in java.net.URL in modularized Java versions --- .../protocol/VfsUrlStreamHandlerFactory.java | 6 +-- .../test/vfs/URLConnectionUnitTestCase.java | 38 ------------------- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/main/java/org/jboss/vfs/protocol/VfsUrlStreamHandlerFactory.java b/src/main/java/org/jboss/vfs/protocol/VfsUrlStreamHandlerFactory.java index ae0a5e48..78e90fa4 100644 --- a/src/main/java/org/jboss/vfs/protocol/VfsUrlStreamHandlerFactory.java +++ b/src/main/java/org/jboss/vfs/protocol/VfsUrlStreamHandlerFactory.java @@ -30,17 +30,15 @@ */ public class VfsUrlStreamHandlerFactory implements URLStreamHandlerFactory { - - private static Map handlerMap = new HashMap(2); + private static Map handlerMap = new HashMap(1); static { - handlerMap.put("file", new FileURLStreamHandler()); handlerMap.put("vfs", new VirtualFileURLStreamHandler()); } - @Override public URLStreamHandler createURLStreamHandler(final String protocol) { return handlerMap.get(protocol); } + } diff --git a/src/test/java/org/jboss/test/vfs/URLConnectionUnitTestCase.java b/src/test/java/org/jboss/test/vfs/URLConnectionUnitTestCase.java index b3dd64d9..54837be4 100644 --- a/src/test/java/org/jboss/test/vfs/URLConnectionUnitTestCase.java +++ b/src/test/java/org/jboss/test/vfs/URLConnectionUnitTestCase.java @@ -18,7 +18,6 @@ package org.jboss.test.vfs; import java.io.ByteArrayOutputStream; -import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -27,14 +26,11 @@ import java.net.URLConnection; import java.nio.file.Files; import java.util.Arrays; -import java.util.concurrent.Executors; import junit.framework.Test; -import org.jboss.vfs.TempFileProvider; import org.jboss.vfs.VFS; import org.jboss.vfs.VFSUtils; import org.jboss.vfs.VirtualFile; -import org.jboss.vfs.protocol.FileURLConnection; import org.jboss.vfs.protocol.VfsUrlStreamHandlerFactory; import org.junit.Assert; @@ -173,40 +169,6 @@ public void testOutsideUrl() throws Exception { assertEquals(file.lastModified(), conn.getLastModified()); } - public void testFileUrl() throws Exception { - // Hack to ensure VFS.init has been called and has taken over the file: protocol - VFS.getChild(""); - URL resourceUrl = getResource("/vfs/test/outer.jar"); - // Hack to ensure the URL handler is not passed down by the parent URL context - URL url = new URL("file", resourceUrl.getHost(), resourceUrl.getFile()); - - // Make sure we are using our handler - URLConnection urlConn = url.openConnection(); - assertTrue(urlConn instanceof FileURLConnection); - - File file = new File(url.toURI()); - assertNotNull(file); - - VirtualFile vf = VFS.getChild(url); - assertTrue(vf.isFile()); - // Mount a temp dir over the jar location in VFS - TempFileProvider provider = null; - Closeable handle = null; - try { - provider = TempFileProvider.create("temp", Executors.newSingleThreadScheduledExecutor()); - handle = VFS.mountTemp(vf, provider); - assertTrue(vf.isDirectory()); - - File vfsDerivedFile = vf.getPhysicalFile(); - File urlDerivedFile = (File) url.getContent(); - // Make sure the file returned by the file: URL is not the VFS File (In other words, make sure it does not use the mounts) - assertTrue(urlDerivedFile.isFile()); - assertFalse(vfsDerivedFile.equals(urlDerivedFile)); - } finally { - VFSUtils.safeClose(handle, provider); - } - } - public void testFileUrlContentType() throws Exception { VFS.getChild(""); URL url = getResource("/vfs/test/test-web.xml"); From 6d4b2144bc576b52a078c6c58f811eea63d4b1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Op=C3=A1lka?= Date: Tue, 12 Sep 2023 12:18:59 +0200 Subject: [PATCH 3/6] [JBVFS-218] Enable github CI --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..978a2a12 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: JBoss VFS CI + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + build-test-matrix: + name: ${{ matrix.jdk-distribution }}-${{ matrix.jdk-version }}-${{ matrix.os }} + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + jdk-distribution: [temurin, adopt-openj9] + jdk-version: [11, 17] + steps: + - name: Configure runner - Linux + if: contains(matrix.os, 'ubuntu') + run: | + sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts" + sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts" + - name: Configure Runner - Windows + if: contains(matrix.os, 'windows') + run: | + echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > %SystemRoot%\System32\drivers\etc\hosts + echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> %SystemRoot%\System32\drivers\etc\hosts + shell: cmd + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.jdk-distribution }} ${{ matrix.jdk-version }} + uses: actions/setup-java@v3 + with: + distribution: ${{ matrix.jdk-distribution }} + java-version: ${{ matrix.jdk-version }} + - name: Run Tests + run: mvn -ntp -U -B -fae clean install + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: surefire-${{ matrix.jdk-distribution }}-${{ matrix.jdk-version }}-${{ matrix.os }} + path: '**/surefire-reports/*.txt' From f0d6fe121bdc28cb69769f00c3300d7bfc5190b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Op=C3=A1lka?= Date: Tue, 12 Sep 2023 12:20:29 +0200 Subject: [PATCH 4/6] [JBVFS-219] Enable github dependabot --- .github/dependabot.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..525fc9fa --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" From b522d0c7c755951e4f51eb0fe04401cb1a29aa79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Op=C3=A1lka?= Date: Fri, 16 Feb 2024 21:24:42 +0100 Subject: [PATCH 5/6] [JBVFS-221] Defining automatic module name is org.jboss.vfs --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index caaa69b4..4849d162 100644 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,17 @@ org.apache.maven.plugins maven-checkstyle-plugin + + org.apache.maven.plugins + maven-jar-plugin + + + + org.jboss.vfs + + + + From ad884e31a840cc2355c5409b05c7041dc1d3b007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Op=C3=A1lka?= Date: Fri, 16 Feb 2024 21:56:50 +0100 Subject: [PATCH 6/6] Upgrading dependencies to latest version --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 4849d162..2a6e374d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.jboss jboss-parent - 39 + 43 4.0.0 @@ -61,10 +61,10 @@ - 3.4.3.Final + 3.5.3.Final 2.2.1.Final 1.2.0.Final - 4.13.1 + 4.13.2 11 11 11 @@ -137,7 +137,7 @@ org.jboss.logging jboss-logging ${version.org.jboss.logging.jboss-logging} - compile + provided org.jboss.logging