One of the pain points of the freestyle project is that you have to configure a lot of things, such as where to look for test reports, what files to archive, where the findbugs report would go. But if we focus on Maven, we should be able to eliminate much of the configuration, since it introduces more uniform structures. So that's what this plugin does — at the expense of limiting the build tool to Maven, automate much of the configuration.
The core idea of the implementation is to monitor what Maven does, so that we can see which mojos are executed with what parameters. In this way, we can tell when/where javadoc is generated, if source code compilation had an error, and access other rich information about the project build process.
To make communication between Hudson JVM and Maven JVM easier, we use the remoting technology that Hudson uses between the controller and the agent. We start a new JVM and bootstraps to the remoting, then use a socket to establish a connection to this process. This part of the code is in the "maven-agent" module. We then bootstrap Maven.
To intercept what's going on in Maven, we extend some key components in Maven, and configure Plexus in such a way that our components are used instead of default ones. Because injected components need to live in a different classloader, they are packaged in a separate "maven-interceptor" module. We also bring in objects (MavenReporters) from plugins via remoting, and distribute intercepted events to these guys. They can then digest information and send it back to Hudson JVM.
In addition to all this, we use embedded Maven to parse POMs, so that we can figure out the structure of the project before we even do a build (this information is used for example to set up dependencies among jobs.) This turns out to be rather fragile (in the presence of profiles that are activated by system property, platform, etc., which makes the effective POM different when in Hudson vs when built for real.)
Interface Summary Interface Description AggregatableAction MavenAggregatedReport MavenArgumentInterceptorActionProvides a hook to change the arguments passed to the maven execution. MavenBuildProxy MavenBuildProxy.BuildCallable<V,T extends Throwable> MavenBuildProxy2A part of
MavenBuildProxythat's used internally for aggregated build.
MavenProjectActionBuilderCan contribute to project actions.
Class Summary Class Description AbstractMavenBuild<P extends AbstractMavenProject<P,B>,B extends AbstractMavenBuild<P,B>> AbstractMavenBuilder AbstractMavenBuilder.FilterImpl AbstractMavenProcessFactoryLaunches the maven process. AbstractMavenProcessFactory.GetRemotingJar AbstractMavenProcessFactory.UserInetTcpSocketHostLocator AbstractMavenProject<P extends AbstractProject<P,R>,R extends AbstractBuild<P,R>> AbstractMavenProject.MavenModuleDependency ExecutedMojoPersisted record of mojo execution. ExecutedMojo.CacheUsed during the HTML rendering to cache the index. FilteredChangeLogSet Maven31ProcessFactory
AbstractMavenProcessFactoryfor Maven 3.
AbstractMavenProcessFactoryfor Maven 3.2.x
AbstractMavenProcessFactoryfor Maven 3.3.x
AbstractMavenProcessFactoryfor Maven 3.5.x
Maven3Builder Maven3Builder.Maven3BuilderRequest Maven3ProcessFactory
AbstractMavenProcessFactoryfor Maven 3.
Maven3ProcessFactory.GetClassWorldsJarFinds classworlds.jar MavenBuild MavenBuilder
Callablethat invokes Maven CLI (in process) and drives a build.
MavenBuildInformation MavenBuildProxy.Filter<CORE extends MavenBuildProxy>Filter for
MavenBuildProxy2.Filter<CORE extends MavenBuildProxy2>Filter for
Jobthat builds projects based on Maven2.
MavenModuleSet.DescriptorImpl MavenModuleSetBuild MavenModuleSetBuild.SimpleTransferListenerwill log in the
TaskListenerwhen transferFailed and transferSucceeded
MavenProbeActionUI for probing Maven process. MavenReporter MavenReporterDescriptor MavenReporters MavenReportInfoInformation about
MavenReportthat was executed.
MavenTestDataPublisher.DescriptorImpl MavenUtil MavenVersionCallable MessagesGenerated localization support class. ModuleDependencygroup id + artifact id + version and a flag to know if it's a plugin ModuleNameVersion independent name of a Maven project. MojoInfoInformation about Mojo to be executed. MojoInfo.Maven3ProvidesNoAccessToMojoInstance will be set to
MojoInfo.mojoto avoid NPE in plugins.
NeedsFullBuildActionAction signalling that this
MavenModuleSetneeds a full build on the next run even if it's marked as an incremental build.
PlexusModuleContributorContributes additional code into Plexus container when we run Maven. PlexusModuleContributorFactoryContributes additional code into Plexus container when we run Maven. PluginImpl PluginNameIdentifier of a specific version of a Maven plugin that consists of groupId, artifactId, and version. ProcessCacheHold on to launched Maven processes so that multiple builds can reuse the same Maven JVM, which leads to improved performance. ProcessCache.NewProcess RedeployPublisher RedeployPublisher.DescriptorImpl RedeployPublisher.WrappedArtifactRepository TcpSocketHostLocatorIdentify the Host name to use from maven-agent to connect to to Jenkins agent TCP socket. UnbuiltModuleActionAction which remembers all module which have not been built since the last successful build though they should have been, because they have SCM changes since then.
Enum Summary Enum Description MavenUtil.MavenVersion