Skip to content

Only set the project artifact if it is the actual JAR#453

Open
mensinda wants to merge 2 commits intoapache:masterfrom
mensinda:fix-449
Open

Only set the project artifact if it is the actual JAR#453
mensinda wants to merge 2 commits intoapache:masterfrom
mensinda:fix-449

Conversation

@mensinda
Copy link
Copy Markdown

@mensinda mensinda commented Feb 5, 2026

Currently, the cached target/classes compile output is marked as the main project artifact when restoring the cache. This causes the issues described in #449. This PR ensures that only a "real" / JAR is marked as the project artifact when the cache is restored.

fixes #449

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@mensinda
Copy link
Copy Markdown
Author

I have downgraded the JDK requirements and removed the toolchains plugin for the testcase. The pipeline should now (hopefully) pass.

@mensinda
Copy link
Copy Markdown
Author

The build failure in https://github.com/apache/maven-build-cache-extension/actions/runs/21949285620/job/63461052355?pr=453 looks unrelated:

Error:  Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:3.1.0:check (default) on project maven-build-cache-extension: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:3.1.0:check failed: Unable to resolve dependencies: Failed to collect dependencies at com.github.ekryd.sortpom:sortpom-sorter:jar:4.0.0: Failed to read artifact descriptor for com.github.ekryd.sortpom:sortpom-sorter:jar:4.0.0: The following artifacts could not be resolved: com.github.ekryd.sortpom:sortpom-sorter:pom:4.0.0 (absent): Could not transfer artifact com.github.ekryd.sortpom:sortpom-sorter:pom:4.0.0 from/to central (https://repo.maven.apache.org/maven2): HTTP connect timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:3.1.0:check (default) on project maven-build-cache-extension: Execution default of goal com.diffplug.spotless:spotless-maven-plugin:3.1.0:check failed: Unable to resolve dependencies

With a lot of HTTP connect timed out in the stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify stage caches an empty directory for the main JAR

2 participants