Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exclusions to Maven plugin #684

Merged
merged 2 commits into from
Mar 5, 2025
Merged

Add exclusions to Maven plugin #684

merged 2 commits into from
Mar 5, 2025

Conversation

melix
Copy link
Collaborator

@melix melix commented Jan 23, 2025

This commit adds an exclusions parameter to the Maven plugin, which can be used to exclude dependencies from the compile classpath of native image.

It can be used to remove some dependencies from compilation, such as these injected by Spring Boot for development. Note, however, that if the main jar is configured to have the manifest with addClaspath to true, then the manifest file will still reference the jar, and native compile will issue a warning (because the jar will be missing from classpath).

Fixes #612

@melix melix added this to the 0.10.6 milestone Jan 23, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 23, 2025
alvarosanchez
alvarosanchez previously approved these changes Jan 23, 2025
@alvarosanchez
Copy link
Member

This needs to be documented somewhere, though. Unfortunately, Maven plugin site is not published

dnestoro
dnestoro previously approved these changes Jan 23, 2025
@melix melix dismissed stale reviews from dnestoro and alvarosanchez via 4d9a511 January 24, 2025 10:02
@melix
Copy link
Collaborator Author

melix commented Jan 24, 2025

@dnestoro the workflow changes are probably required on all PRs, it just happened to fail suddenly yesterday, because GH actions changed behavior wrt the deprecated v3 version of upload-artifact.

melix added 2 commits March 4, 2025 10:42

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This commit adds an `exclusions` parameter to the Maven plugin,
which can be used to exclude dependencies from the compile
classpath of native image.

It can be used to remove some dependencies from compilation,
such as these injected by Spring Boot for development. Note,
however, that if the main jar is configured to have the
manifest with `addClaspath` to true, then the manifest file
will still reference the jar, and native compile will
issue a warning (because the jar will be missing from classpath).

Fixes #612

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@dnestoro dnestoro merged commit b0863f4 into master Mar 5, 2025
45 checks passed
@dnestoro dnestoro deleted the cc/issue-612 branch March 5, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude dependencies from native-image
3 participants