question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native profile should configure execution in pluginManagement

See original GitHub issue

When 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:closed
  • Created 10 months ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
snicollcommented, Nov 17, 2022

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.

0reactions
snicollcommented, Nov 22, 2022

As I suspected, changing process-aot to skip a pom 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found