Skip to content

Commit

Permalink
Merge branch 'release/3.6.x' into refactoring/430-Resolving-type-syst…
Browse files Browse the repository at this point in the history
…em-imports-through-SPIs-slows-things-down-too-much

* release/3.6.x:
  Issue #435: Improve performance of ImportResolver
  • Loading branch information
reckart committed Feb 17, 2025
2 parents 43918a3 + 79f6f85 commit a308e23
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "main", "release/**" ]
pull_request:
branches: [ "main", "release/**" ]

jobs:
build:
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
os: [ubuntu-latest, windows-latest]
jdk: [17]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}

- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: maven
server-id: apache.snapshots.https
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD

- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.9

- name: Set up cache date
run: echo "CACHE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Build with Maven
run: mvn --show-version --batch-mode --no-transfer-progress clean verify

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure() # always run even if the previous step fails
with:
report_paths: '**/target/surefire-reports/TEST-*.xml'

- name: Upload to Nexus
if: matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request'
env:
# `NEXUS_USERNAME` and `NEXUS_PASSWORD` are used in `~/.m2/settings.xml` created by `setup-java` action
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PW }}
run: mvn --show-version --batch-mode --errors --no-transfer-progress -DskipTests deploy
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ protected boolean fileExistsAtUrl(URL aUrl) {
// Ensure that we actually always check the resource for existence. In case of a JAR URL,
// this is also important to ensure that the ZIP/JAR file is closed again.
var connection = aUrl.openConnection();
connection.setDefaultUseCaches(false);
connection.setUseCaches(false);
try (var testStream = connection.getInputStream()) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ protected Class<?> loadClass(String aName, boolean aResolve) throws ClassNotFoun
try {
// Disable JAR cache so JUnit can delete the temporary folder after the test
var urlConnection = url.openConnection();
urlConnection.setDefaultUseCaches(false);
urlConnection.setUseCaches(false);

try (InputStream is = urlConnection.getInputStream()) {
var buffer = new ByteArrayOutputStream();
Expand Down

0 comments on commit a308e23

Please sign in to comment.