-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[JENKINS-75622] Maven Daemon support #10831
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
base: master
Are you sure you want to change the base?
Conversation
/label bug |
mvnd
executableThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This change should be documented in some manner on the UI. I'd be surprised to learn It seems unexpected that (Nit-picking) Why is lack of support of an entire different project a bug? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I declare a potential conflict of interest, but I would be also surprised if Jenkins started silently using the daemon executable, even as a fallback to mvn
in the home.
P.S: I guess, the same call should ideally check mvnw
, too
|
AFAIU, all the help messages from Tools UI are generic and I can't see any place to add information about Maven Deamon support. The messages are even not Maven specific and are generic for any tool. ![]()
I tried first to not assign So 023efd4 adjusts the environment variables to embedded Maven subdirectory: M2_HOME=${mvnd.home}/mvn/
MAVEN_HOME=${mvnd.home}/mvn/ FTR, Maven Daemon directory tree (filtered):
Notice that Tested using: withMaven {
sh "$MVN_CMD --version"
sh "echo MAVEN_HOME=$MAVEN_HOME"
} Resulting log:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the fix...
/home/jerome/devel/jenkinsci/jenkins/war/work/workspace/job1@tmp/withMavenfb7d168d/mvnd --version
This starts a maven daemon (if one does not already exist). I'm not convinced that would be expected and certainly nothing would be attempting to close it down would it?
The daemon has the JENKINS_COOKIE
in its environment so it will be killed at the end of use by the ProcessTreeKiller
/ process cleanup code. I expect this to cause issues when you have multiple executors per agent, as an agent will be killed when it could be in use elsewhere.
I'm not actually sure you even need any changes - you have the "optional directory of the downloaded and unpacked archive" in the case of mvnd it is just mvn
isn't it?
// Maven 2.x and earlier | ||
return exe.getPath(); | ||
} | ||
exe = getExeFile("mvnd", rawHome); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this to me is strange. this is not maven it is maven-deamon and is a different thing.
if you want this to be a maven installation when it is not - it should still return the mvn from the sub directory.
starting maven daemon (and indeed shutting it down) would not be performed (correctly) by any calling code without changes, nor is the output expected to be the same.
See JENKINS-75622.
When using Apache Maven Daemon as Maven tool, the
withMaven
pipeline step is looking formvn
executable instead ofmvnd
. This results in warning log andMVN_CMD
not valued.Build log (before the fix):
This PR adds "mvnd" to the executable candidates searched by
MavenInstallation
.Build log (after the fix):
Testing notes
mvn
normvnd
in the systemPATH
M3
tool using Maven Daemon 1.0.2$MVN_CMD
and triggers the buildProposed changelog entries
withMaven
pipeline step setsMVN_CMD
variable tomvnd
instead ofmvn
when using Apache Maven Daemon.Proposed changelog category
/label
Proposed upgrade guidelines
N/A
Submitter checklist
@Restricted
or have@since TODO
Javadocs, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
, if applicable.eval
to ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist
upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidate
to be considered (see query).