Skip to content

Instantly share code, notes, and snippets.

@aldaris
Last active December 17, 2015 16:59
Show Gist options
  • Save aldaris/5642634 to your computer and use it in GitHub Desktop.
Save aldaris/5642634 to your computer and use it in GitHub Desktop.
Jenkins+Artifactory notes
How the Jenkins build works:
To debug the start of the Maven build go for MavenModuleSetBuildExecution#doRun.
Basically during job start some of the extensions are called to create these build properties file that contains lots of information on where to deploy and what, the same set of data hence should be available when actually running the build. (becomes a temp file in tempdir), after it's set up.
ProcessCache#MavenProcess constructor is a good place to actually see the maven-agent3 starting cli command, although it should be logged in build console as well.
At somewhere very low on the stack a ProcessCache#call method will be invoked.
Basically when you do a Maven build that will kick off a new process running using the Maven3Main class from maven3-agent, and uses TCP connections to share data across the processes. On the forked process side you can look at Maven3Launcher class, where it will actually invoke the Maven3 execute method, after that you just run the build nicely from Maven itself.
Artifactory as a regular bastard of course uses an AbstractLifecycleListenerParticipant implementation coming from build-info-extractor-maven3 or whatnot (see -Dm3plugin.lib JVM property), and basically that listener will be invoked with onSessionEnded when the build has pretty much finished. See also BuildInfoRecorder which is invoked open projectSucceeded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment