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

Maven Native plugin fails on POM packaging projects #490

Closed
stevenschlansker opened this issue Aug 24, 2023 · 3 comments
Closed

Maven Native plugin fails on POM packaging projects #490

stevenschlansker opened this issue Aug 24, 2023 · 3 comments
Labels
enhancement New feature or request invalid This doesn't seem right maven-plugin Related to Maven plugin

Comments

@stevenschlansker
Copy link

stevenschlansker commented Aug 24, 2023

I am adding native-image support to an open source project by user request. I would like to run all of my project's tests through the native build pipeline in order to verify that the provided native-image.properties configuration works. I add native-maven-plugin test-native per documentation to the project parent pom.

jar packaging projects work fine, but we have a few pom packaging projects (like a BOM) and these fail with:

[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.24:compile-no-fork (build-native)
   on project jdbi3-bom: Image classpath is empty. Check if your classpath configuration is correct. -> [Help 1]

The project is a POM, there is no classpath, and this is okay. Should the native-maven-plugin skip such projects entirely?

Workaround: add a file-missing activation to the native profile, and then create that file in each project you wish to skip native processing.

@stevenschlansker stevenschlansker added the enhancement New feature or request label Aug 24, 2023
@alvarosanchez alvarosanchez added enhancement New feature or request invalid This doesn't seem right maven-plugin Related to Maven plugin and removed enhancement New feature or request labels Aug 25, 2023
@alvarosanchez
Copy link
Member

This plugin should only be added to the projects where it should run.

The correct solution is to declare the plugin and its configuration in your parent POM in the pluginManagement section, and then reference the plugin in each of the subprojects where it should run.

@alvarosanchez alvarosanchez closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@stevenschlansker
Copy link
Author

That means that for each of 20 projects that want to use it, I have to declare it separately, just to exclude 2 :(

@alvarosanchez
Copy link
Member

In that case, you can configure the plugin in your parent POM as you are doing now, then in those 2 projects override the configuration and set <skipNativeBuild>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right maven-plugin Related to Maven plugin
Projects
None yet
Development

No branches or pull requests

2 participants