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

Unlike other Spring Boot goals, process-aot and process-test-aot run on Maven reactor projects #35377

Conversation

ls-urs-keller
Copy link
Contributor

@ls-urs-keller ls-urs-keller commented May 10, 2023

When running in multi module maven projects, the aot phase should not run on modules with type POM

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 10, 2023
@snicoll
Copy link
Member

snicoll commented May 10, 2023

It won't, unless the spring-boot-maven-plugin is applied or you have configured an execution in the parent in plugins rather than pluginsManagement.

I think this sort of change is actually hiding a build setup issue. See also #33184.

Can you please check your build and get back to us with a reason for this change?

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label May 10, 2023
@ls-urs-keller
Copy link
Contributor Author

ls-urs-keller commented May 10, 2023

It won't, unless the spring-boot-maven-plugin is applied or you have configured an execution in the parent in plugins rather than pluginsManagement.

That's the case, but it is also a valid use case assuming a common parent project and N services all similarly configured inheriting dependencies and plugins from the parent.

We do this this way already for the repackage goal:

Otherwise we would have to remove the spring-boot-plugin from <build><plugins>... and repeat it in every module. Or add a skip in the parent and set that to false in all the modules.

The suggestion here is to align the behaviour process-aot with what's already a reality in repackage goal which also skips over reactor modules.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 10, 2023
@snicoll
Copy link
Member

snicoll commented May 10, 2023

Are all your sub-modules spring boot applications?

We do this this way already for the repackage goal:

I am aware of that and I've explained above why I'd like to get a bit more detail about the setup.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels May 10, 2023
@ls-urs-keller
Copy link
Contributor Author

Are all your sub-modules spring boot applications?

We do this this way already for the repackage goal:

I am aware of that and I've explained above why I'd like to get a bit more detail about the setup.

We also have library projects not spring boot, for those we add a repackage skip =true.
But those tend to be fewer.

Of course, we could do it the other way around adding a skip = false for those that need repackaging/aot-processing.

The process-aot goal behaves inconsistently with respect to the repackaging goal within the same plugin, maybe the solution is to remove the code from repackaging, but that would probably break things.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 10, 2023
@snicoll
Copy link
Member

snicoll commented May 10, 2023

Of course, we could do it the other way around adding a skip = false for those that need repackaging/aot-processing.

You could rather configure the execution for the plugin in your parent with whatever settings you need in pluginManagement and then add the plugin definition in the projects that need it. That's what start.spring.io does with our parent for a fresh project.

And your library projects would not have any reference to Spring Boot at all. This is a better arrangement IMO as the spring boot plugin is only applied where it is necessary rather than applying it in the reactor for all modules and skipping things.

The process-aot goal behaves inconsistently with respect to the repackaging goal within the same plugin,

run does not skip on pom projects. Checking for pom always was an escape hatch for those who were applying a plugin globally in the reactor.

That being said, we could add this check, I'll check with the rest of the team.

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label May 10, 2023
@ls-urs-keller
Copy link
Contributor Author

ls-urs-keller commented May 10, 2023

And your library projects would not have any reference to Spring Boot at all. This is a better arrangement IMO as the spring boot plugin is only applied where it is necessary rather than applying it in the reactor for all modules and skipping things.

We are using flatten plugins for this, since the libraries we publish need to have a flat pom anyway we configure it to remove most things except the deps. But I guess that's opinionated.

run does not skip on pom projects. Checking for pom always was an escape hatch for those who were applying a plugin globally in the reactor.

True, run doesn't skip.

@wilkinsona wilkinsona changed the title Don't run process-aot on maven reactor projects Don't run process-aot on Maven reactor projects Jul 20, 2023
@wilkinsona wilkinsona changed the title Don't run process-aot on Maven reactor projects Unlike other Spring Boot goals, process-aot runs on Maven reactor projects Jul 20, 2023
@wilkinsona wilkinsona added type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Jul 20, 2023
@wilkinsona wilkinsona added this to the 3.0.x milestone Jul 20, 2023
@wilkinsona wilkinsona changed the title Unlike other Spring Boot goals, process-aot runs on Maven reactor projects Unlike other Spring Boot goals, process-aot and process-test-aot run on Maven reactor projects Jul 21, 2023
@wilkinsona wilkinsona self-assigned this Jul 21, 2023
@wilkinsona wilkinsona modified the milestones: 3.0.x, 3.0.10 Jul 21, 2023
@wilkinsona
Copy link
Member

@ls-urs-keller Thanks very much for making your first contribution to Spring Boot.

@ls-urs-keller ls-urs-keller deleted the aot_should_not_run_on_pom branch July 24, 2023 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants