JBoss Community

Currently Being Moderated

Maven

VERSION 23

Created on: Mar 15, 2007 12:02 PM by Paul Gier - Last Modified:  Apr 17, 2008 6:01 AM by Scott Stark

This page is a central location for information about the maven based JBoss build system.

 

Getting started with Maven

 

If you want to learn how maven works, a good place to start is MavenIntroduction

 

Also check out Maven: The Definitive Guide

 

FAQ MavenFAQ

 

Using maven to build JBoss projects

 

A basic install of maven is required.  The installation is just downloading

and unzipping the zip file, and then adding $MAVEN_HOME/bin to your path.

 

Next, you should review the jboss recommended MavenSettings.  This page will help you configure maven with the appropriate settings for jboss projects.

 

Maven can be called from the command line using the command mvn.  For jboss projects that use the

common parent pom configuration, this will call mvn install, which will compile your classes and test-classes, run tests, package files

into jars, and copy these jars to a local repository where they can be used by other projects.

 

If you just want to compile your project mvn compile.

 

A description of the common maven build phases can be found at http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html.

 

If you want to integrate some of the maven functionality with eclipse, this can be done with the m2eclipse plugin

 

Choosing a groupId and artifactId for your project

 

MavenProjectNaming

 

Using the maven repositories

There are two repositories currently available for maven projects to use.

1. A snapshot repository for development builds.

2. A releases repository for release builds.

 

More information about deploying artifacts to these repositories can be found here:

 

MavenSnapshotRepository

 

MavenReleaseRepository

 

Deploying artifacts to the legacy JBoss repository

 

As we migrate from an ant based build system to a maven based build system, it is often useful

to deploy build artifacts to the ant repository.  In order to do this, you will need to set a system

property called "jboss.repository.root" either on the command line or in the maven settings.xml.

This property should point to a local checkout of the jboss repository "repository.jboss.com".

 

From the command line:

mvn -Djboss.repository.root=/home/me/repository.jboss.com deploy

 

Or you can set it using a profile in maven_home/conf/settings.xml

First add the profile:


     <profile>
      <id>local-properties</id>
      <properties>
        <!-- This must point to the cvs or svn checkout of the jboss repository -->
        <jboss.repository.root>/home/me/repository.jboss.com</jboss.repository.root>
      </properties>
    </profile>

Then tell maven that this profile should always be active:


  <activeProfiles>
    <activeProfile>local-properties</activeProfile>
  </activeProfiles>

Then just type "mvn deploy" and maven will deploy to both the jboss ant repository and the maven repository.

 

JBoss Maven Plugins

 

If you would like to create a new maven plugin, see CreatingMavenPlugins.

 

JbossDeployMavenPlugin - Plugin to deploy artifacts to the non-maven repository.

 

JbossRetroMavenPlugin - Plugin to call jbossretro to generate jdk1.4 compatible files.

 

MavenBuildmagicThirdpartyPlugin - Plugin to build the legacy thirdparty JBossAS structure from a maven2 repository.

 

Releasing Software with Maven

 

MavenReleaseProcess

 

Status of JBoss Mavenization

 

The MavenizationStatus page provides an overview of jboss projects and where they are in the process of mavenization.

 

The JBBUILD project in Jira provides some additional information about issues that need to be completed.

 

In Progress

 

MavenITRequirements - IT is in the process of setting up our new maven build system.

 

Uploading third party artifacts

 

MavenThirdPartyJars

 

Generating a project site/JBoss.org integration

MavenSiteGeneration

 

Maven presentation notes

 

MavenPresentationNotes

 

 

 

Referenced by:

 

 

 

Average User Rating
(0 ratings)




There are no comments on this article

More Like This

  • Retrieving data ...