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

Use of -rf flag breaks multi-reactor builds #12

Open
SamuelCook opened this issue Jul 30, 2021 · 3 comments · May be fixed by #18
Open

Use of -rf flag breaks multi-reactor builds #12

SamuelCook opened this issue Jul 30, 2021 · 3 comments · May be fixed by #18

Comments

@SamuelCook
Copy link

SamuelCook commented Jul 30, 2021

The -rf / --resume-from flag can be used to resume a Maven build from a particular project. This is useful when fixing an error in a project in the middle of a reactor - it is not necessary to rebuild the projects that do not depend on the failing project.

When using mvnmin the -rf flag is passed down to Maven, and works as expected for single-reactor builds. However, it does not function for multi-reactor builds.

Since the -rf flag is always passed down to the running Maven build, it will be present for reactors that do not contain the project from which the build should resume. When mvnmin attempts to build a reactor that does not contain the project, Maven, and consequently, mvnmin, fails with the following message:

[ERROR] [ERROR] Could not find project to resume reactor build from: :<resume-from-project> vs <reactor that does not include the project> @
[ERROR] Could not find project to resume reactor build from: :<resume-from-project> vs <reactor that does not include the project> -> [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/MavenExecutionException

mvnmin: Maven failed to run successfully.

mvnmin should intercept the -rf / --resume-from flag and pass it down to Maven only in reactors that include the specified project.

@ivanjensen-ep
Copy link
Collaborator

Hi @SamuelCook,

Sorry for the slow response, It seems my notifications are not configured properly. Yes, this is a known limitation of mvnmin currently.

I had considered intercepting -rf previously, having hit the same irritation. I didn't try it, because I thought it might be tricky. But now you suggest it, I can't think why that would be. I'll take a look into this when I get a chance, thanks for the suggestion.

-Ivan

@ivanjensen-ep ivanjensen-ep linked a pull request Jan 29, 2022 that will close this issue
@ivanjensen-ep
Copy link
Collaborator

@SamuelCook You later issue on -am and -amd got me thinking about this again.

I think I've added initial -rf support in the pr #18. I haven't done any serious testing, but on its face it seems like it works. The PR simply sets all sub reactors to skip until the one flagged by the rf arg, and then things progress as before.

Does that match your expectations?

Does that

@SamuelCook
Copy link
Author

Yes, that seems about right to me.

Don't forget that you also need to omit the flag in later reactors that do not include the resume-from module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants