Maven Project Configuration Requirements

All JBoss projects must follow the groupId/artifactId guidelines (MavenProjectNaming).

 

Note that the groupId "jboss" is deprecated and should be replaced by "org.jboss".  For more information, see Maven JBoss GroupIds

 

Source Jars

 

During the release staging process, Nexus will verify that each artifact in your release must have an associated source jar.  For example an project which produces my-jboss-project-1.0.jar, must also produce my-jboss-project-1.0-sources.jar.

 

Pom Validation

 

All JBoss project POMs must contain (or inherit from a parent pom) the following information:

 

  • modelVersion
  • groupId
  • artifactId
  • version
  • packaging (defaults to jar)
  • name
  • description
  • url
  • licenses
  • scm/url
  • scm/connection
  • scm/developerConnection
  • developers

 

The field scm/url should contain the project fisheye URL (http://fisheye.jboss.org)

If you set the parent pom to org.jboss:jboss-parent version 5 or higher, then default values are provided for all the fields.

 

Things Not to include

Since every artifact in jboss repo is mirrored to Maven central many projects have a tendency to include repository information in their pom.xml.

 

That makes it easy to build out of the box but it also leaks that repository information into all projects that uses your pom and thus your project can be affecting which repository a users build are using which can result in hard to trace and debug issues concerning dependency resolution.

 

Thus do not include repository info in your pom files - if you want to provide an easy way to get the list of suggested repositories include a settings.xml into your project and use "mvn -s settings.xml" when building the project.

 

POM Template

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>[groupId]</groupId>
  <artifactId>[artifactId]</artifactId>
  <version>1.0</version>
  <name>[project name]</name>
  <description>[project description]</description>
  <url>[project url]</url>
  <licenses>
    <license>
      <name>[license name]</name>
      <url>[license url]</url>
    </license>
  </licenses>
  <scm>
    <url>http://fisheye.jboss.org/browse/[path to repo]</url>
    <connection>http://anonsvn.jboss.org/repos/[path to repo]</connection>
    <developerConnection>https://svn.jboss.org/repos/[path to repo]</developerConnection>
  </scm>
  <developers>
    <developer>
      <id>[jboss.org username]</id>
      <name>[developer name]</name>
      <organization>[developer organization]</organization>
    </developer>
  </developers>
  
</project>