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

[MRELEASE-851]: javaHome argument is now honored in InvokerMavenExecutor #182

Merged
merged 1 commit into from Apr 20, 2023

Conversation

prof-schnitzel
Copy link

I don't know why this bug does not get fixed. The documentation clearly says that you can use the argument -DjavaHome= to set the path to your jdk, but this parameter is not used anywhere in the code, thereby completely ignored. This is a huge pain for people who are using CI/CD servers (for example jenkins) with multiple jdks installed. In that case the release plugin is not usable.

So I adjusted the InvokerMavenExecutor so that it honors the javaHome argument.

@olamy olamy added the bug label Apr 17, 2023
@prof-schnitzel prof-schnitzel changed the title MRELEASE-851: javaHome argument is now honored in InvokerMavenExecutor [MRELEASE-851]: javaHome argument is now honored in InvokerMavenExecutor Apr 17, 2023
@prof-schnitzel
Copy link
Author

@olamy Is there a chance to get this quickly merged and released?

@olamy olamy requested a review from michael-o April 19, 2023 08:15
@michael-o
Copy link
Member

@prof-schnitzel I will check the issue and then the code and let you know.

@olamy
Copy link
Member

olamy commented Apr 19, 2023

@olamy Is there a chance to get this quickly merged and released?

yes there is definitely a chance! I was just waited for other folks to review just in case.

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a slight problem with this PR, this it is correct, it is also incomplete. the actual issue says: "javaHome is ignored and inherited unexpected". So this should apply to both invoker (InvokerMavenExecutor) and forked-path (ForkedMavenExecutor).

For the ForkedMavenExecutor the JAVA_HOME env var isn't set.

Please make it consistent.

WDYT?

@prof-schnitzel
Copy link
Author

prof-schnitzel commented Apr 19, 2023

@michael-o Yes, you are right. I never use forked-path, thats why I skipped that. But I added the relevant code lines, so that ForkedMavenExecutor now also respects -DjavaHome.

@michael-o
Copy link
Member

@prof-schnitzel , I have another problem, maybe you can share your opinion: The mojo parameters use ${java.home} which does not necessarily is ${env.JAVA_HOME}. I'd either change the documention not to mention JAVA_HOME or use the env. Using the env does not guarantee the value to be present. WDYT?

@prof-schnitzel
Copy link
Author

prof-schnitzel commented Apr 19, 2023

@michael-o Thats correct. ${java.home} is a dynamic property showing you which JRE is running your maven build and is not necessarily the same as ${env.JAVA_HOME}. I would suggest to change the documentation not to mention JAVA_HOME. Using the env would be a breaking change. Using the env wouldn't be consistent since all other default maven plugins are using ${java.home}.

@michael-o michael-o force-pushed the bugfix/MRELEASE-851-javaHome branch from de37a41 to f96c6bc Compare April 20, 2023 07:37
@michael-o michael-o self-requested a review April 20, 2023 07:37
@asfgit asfgit merged commit f96c6bc into apache:master Apr 20, 2023
1 check passed
@extern-matthias-kampmeyer

@michael-o Do you have any idea when this will be released?

@michael-o
Copy link
Member

@michael-o Do you have any idea when this will be released?

Not before May. I am waiting for fixes from @slawekjaranowski .

@slawekjaranowski
Copy link
Member

@michael-o Do you have any idea when this will be released?

Not before May. I am waiting for fixes from @slawekjaranowski .

Which one?

@michael-o
Copy link
Member

@michael-o Do you have any idea when this will be released?

Not before May. I am waiting for fixes from @slawekjaranowski .

Which one?

Maven Shared Utils with the StreamFeeder/Pumper.

@slawekjaranowski
Copy link
Member

Maven Shared Utils with the StreamFeeder/Pumper.

Was done apache/maven-shared-utils#113

@michael-o
Copy link
Member

Maven Shared Utils with the StreamFeeder/Pumper.

Was done apache/maven-shared-utils#113

Now we need a patch release of m-s-utils?

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