Native profile should configure execution in pluginManagement
See original GitHub issueWhen using Spring Boot Maven plugin 3.0.0-RC2 with a multi-module Maven project, the plugin fails to run at the parent level when packaging is set to pom
.
It turns out that the process-aot
target is trying to run, but since there is no source code the plugins fails:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.321 s
[INFO] Finished at: 2022-11-15T11:39:28+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.0-RC2:process-aot (process-aot) on project wnisb3-otel-parent: Unable to find a suitable main class, please add a 'mainClass' property -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
As a workaround, I set <skip>true</skip>
when the Maven project packaging is set to pom
.
Issue Analytics
- State:
- Created 10 months ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Introduction to build profiles - Apache Maven
A profile can be activated in several ways: From the command line; Through Maven settings; Based on environment variables; OS settings; Present or...
Read more >Maven Tips and Tricks - ITNEXT
The execution block is a great way to isolate a configuration to ... Now you can also do this with profiles but using...
Read more >Spring Boot Maven Plugin Documentation
An execution of the repackage goal with a repackage execution id. A native profile that configures the build to be able to generate...
Read more >Plugin Management in Maven - Baeldung
2. Plugin Configuration · Build – executed during the build process. Examples include Clean, Install, and Surefire plugins. These should be ...
Read more >org.graalvm.buildtools : native-maven-plugin : 0.9.1
GraalVM Native Maven Plugin - Plugin that provides support for building and testing of GraalVM native images (ahead-of-time compiled Java code).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am aware of that. I am just saying that even if we do this (we could), your setup will work by accident more than anything else. Please review the comment.
As I suspected, changing
process-aot
to skip apom
project isn’t achieving anything (besides hiding the actual issue). I’ve pushed some change to the native profile so that it is multi-modules friendly. I’ve also updated the reference guide to describe what it does and how it should be used within a multi-modules setup.There are a number of sample projects in this PR to the smoke tests repo that summarizes it all.