diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1e60090..d5868085 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,18 +14,18 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: 17 - name: Cache local Maven repository - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - name: Set up Docker - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build with Maven run: mvn --no-transfer-progress --batch-mode verify diff --git a/pom.xml b/pom.xml index af8ec4d5..1b8e3982 100644 --- a/pom.xml +++ b/pom.xml @@ -50,12 +50,12 @@ org.apache.maven.plugins maven-jar-plugin - 3.3.0 + 3.4.2 org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 org.apache.maven.plugins @@ -65,52 +65,52 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 org.apache.maven.plugins maven-javadoc-plugin - 3.6.2 + 3.11.2 org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.5.2 org.apache.maven.plugins maven-failsafe-plugin - 3.2.2 + 3.5.2 org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.3 org.apache.maven.plugins maven-release-plugin - 3.0.1 + 3.1.1 org.apache.maven.plugins maven-site-plugin - 3.12.1 + 3.21.0 org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.5 + 3.8.0 org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.7 org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 @@ -258,13 +258,20 @@ 8 false + 4.5.14 + 2.0.16 jakarta.activation jakarta.activation-api - 2.1.2 + 2.1.3 + + + commons-codec + commons-codec + 1.17.2 @@ -272,37 +279,37 @@ org.apache.httpcomponents httpclient - 4.5.14 + ${httpclient.version} jakarta.xml.bind jakarta.xml.bind-api - 4.0.1 + 4.0.2 org.glassfish.jaxb jaxb-runtime - 4.0.4 + 4.0.5 runtime org.slf4j slf4j-api - 2.0.7 + ${slf4j.version} test org.slf4j slf4j-simple - 2.0.7 + ${slf4j.version} test org.apache.ant ant - 1.10.14 + 1.10.15 provided @@ -315,7 +322,7 @@ org.testcontainers postgresql - 1.19.1 + 1.20.4 test diff --git a/src/main/java/com/github/sardine/impl/SardineImpl.java b/src/main/java/com/github/sardine/impl/SardineImpl.java index c6f00dfd..ac45e2ee 100644 --- a/src/main/java/com/github/sardine/impl/SardineImpl.java +++ b/src/main/java/com/github/sardine/impl/SardineImpl.java @@ -373,8 +373,8 @@ public void enablePreemptiveAuthentication(String hostname, int httpPort, int ht // Generate Basic preemptive scheme object and stick it to the local execution context BasicScheme basicAuth = new BasicScheme(credentialsCharset); // Configure HttpClient to authenticate preemptively by prepopulating the authentication data cache. - cache.put(new HttpHost(hostname, httpPort, "http"), basicAuth); - cache.put(new HttpHost(hostname, httpsPort, "https"), basicAuth); + cache.put(new HttpHost(hostname, httpPort == -1 ? 80 : httpPort, "http"), basicAuth); + cache.put(new HttpHost(hostname, httpsPort == -1 ? 443 : httpsPort, "https"), basicAuth); } @Override