Since Lion 10.7.1 10.6.8 MacOSx Snow Leopard (correct me if wrong), Mac OS X comes with Apache Maven 3 built in, and can be located at /usr/share/maven 1. Maven Built-In. Apache Maven is a software project management and comprehension tool.

This plugin adds a new build parameter List maven artifact versions. If you select this type and enter a repositoryURL,groupId and artifactId the plugin will check for that artifact at the given repository and let whoever started thebuild select a version of the artifact to bind as a build parameter.

There are also several options to provide default values which will also be evaluated at run-time:

  • FIRST - will evaluate to the first item in the drop-down that would have been presented had the build been executed manually
  • LAST - will evaluate to the last item in the drop-down that would have been presented had the build been executed manually.
  • RELEASE - will evaluate to the version marked as release in the maven-metadata.xml for the configured artifact.The versionFilter even if defined is ignored for this default value.
  • LATEST - will evaluate to the version marked as latest in the maven-metadata.xml for the configured artifact.The versionFilter even if defined is ignored for this default value.

This plugin does not download anything but rather sets build environment variables describing the artifact andwhere it can be downloaded from.

If all you need to do is download an artifact from a repository and use it during your build you can consider using theRepository Connector Plugin plugin instead.

Development

Requirements

Built and tested against Jenkins 2.32.1.

Development workspace

When starting the development Jenkins using mvn hpi:run and the work directory containing the JENKINS_HOME doesn'talready exist, the workspace will be created with some pre-configured test jobs for the plugin. The re-creation of thedevelopment workspace can be forced by deleting the work directory before running mvn hpi:run - of course, all manualchanges, as well as build histories will be lost then.

If You're developing behind a proxy and/or a Maven Repository Manager,it may be useful to change the repoBaseUrl to the base URL of Your organisations repository manager. This can easilybe achieved by setting the system property dev.repoBaseUrl when starting the development Jenkins for the first time(after the work directory was deleted). You may just set the system property in Your MAVEN_OPTS..

Author:

  • Georgi 'Gesh' Markov @markov

Further maintainer(s):

  • Marc Rohlfs @marcrohlfs

Contributors:

  • Benjamin Bonnet @bonnetb
  • David Portabella @dportabella
  • Dominik Bartholdi @imod
  • Mathieu Pousse @mathieu-pousse
  • Mads Mohr Christensen @hrmohr
  • Nandor Galambosi @dromie
  • Robert Kleinschmager @barclay-reg

Copyright:: 2012-2014, Georgi 'Gesh' Markov

Licensed under the MIT License

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the 'Software'), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.

  • Maven Tutorial
  • Maven Useful Resources
  • Selected Reading

What is Maven?

Maven is a project management and comprehension tool that provides developers a complete build lifecycle framework. Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.

In case of multiple development teams environment, Maven can set-up the way to work as per standards in a very short time. As most of the project setups are simple and reusable, Maven makes life of developer easy while creating reports, checks, build and testing automation setups.

Maven provides developers ways to manage the following −

  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution
  • Mailing list

To summarize, Maven simplifies and standardizes the project build process. It handles compilation, distribution, documentation, team collaboration and other tasks seamlessly. Maven increases reusability and takes care of most of the build related tasks.

Maven Evolution

Maven was originally designed to simplify building processes in Jakarta Turbine project. There were several projects and each project contained slightly different ANT build files. JARs were checked into CVS.

Apache group then developed Maven which can build multiple projects together, publish projects information, deploy projects, share JARs across several projects and help in collaboration of teams.

Objective

The primary goal of Maven is to provide developer with the following −

  • A comprehensive model for projects, which is reusable, maintainable, and easier to comprehend.

  • Plugins or tools that interact with this declarative model.

Maven project structure and contents are declared in an xml file, pom.xml, referred as Project Object Model (POM), which is the fundamental unit of the entire Maven system. In later chapters, we will explain POM in detail.

Convention over Configuration

Maven uses Convention over Configuration, which means developers are not required to create build process themselves.

Developers do not have to mention each and every configuration detail. Maven provides sensible default behavior for projects. When a Maven project is created, Maven creates default project structure. Developer is only required to place files accordingly and he/she need not to define any configuration in pom.xml.

As an example, following table shows the default values for project source code files, resource files and other configurations. Assuming, ${basedir} denotes the project location −

ItemDefault
source code${basedir}/src/main/java
Resources${basedir}/src/main/resources
Tests${basedir}/src/test
Complied byte code${basedir}/target
distributable JAR${basedir}/target/classes

In order to build the project, Maven provides developers with options to mention life-cycle goals and project dependencies (that rely on Maven plugin capabilities and on its default conventions). Much of the project management and build related tasks are maintained by Maven plugins.

Developers can build any given Maven project without the need to understand how the individual plugins work. We will discuss Maven Plugins in detail in the later chapters.

Features of Maven

  • Simple project setup that follows best practices.

  • Consistent usage across all projects.

  • Dependency management including automatic updating.

  • A large and growing repository of libraries.

  • Extensible, with the ability to easily write plugins in Java or scripting languages.

  • Instant access to new features with little or no extra configuration.

  • Model-based builds − Maven is able to build any number of projects into predefined output types such as jar, war, metadata.

    Software A free trial is available, and single user licenses start at $349.

  • Coherent site of project information − Using the same metadata as per the build process, maven is able to generate a website and a PDF including complete documentation.

  • Release management and distribution publication − Without additional configuration, maven will integrate with your source control system such as CVS and manages the release of a project.

  • Backward Compatibility − You can easily port the multiple modules of a project into Maven 3 from older versions of Maven. It can support the older versions also.

  • Automatic parent versioning − No need to specify the parent in the sub module for maintenance.

  • Parallel builds − It analyzes the project dependency graph and enables you to build schedule modules in parallel. Using this, you can achieve the performance improvements of 20-50%.

  • Better Error and Integrity Reporting − Maven improved error reporting, and it provides you with a link to the Maven wiki page where you will get full description of the error.