Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
iconfalse
titleTable of Contents
Table of Contents
maxLevel3

How to Use

Just add the following parent declaration in your project parent POM :

Code Block
titlepom.xml
langxml
<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.codehaus.sonar-plugins</groupId>
    <artifactId>parent</artifactId>
    <version>14</version>
    <relativePath>../parent</relativePath>
  </parent>
  ...
</project>

How to upgrade

Just change the version of the parent pom you used previously. Have a look at each release note of each version you upgrade to see if there are some notable changes which require to modify something in your project.

How to configure

The parent defines and uses a set of custom properties that can be reused and/or overrided by projects to customize the default behavior of maven defined in the parent pom.

License

Define licenses, inceptionYear and organization :

Code Block
titlepom.xml
langxml
<inceptionYear>2010</inceptionYear>
<organization>
  <name>MyCompany</name>
  <url>http://mycompany.com</url>
</organization>
<licenses>
  <license>
    <name>GNU LGPL v3</name>
    <url>http://www.gnu.org/licenses/lgpl.txt</url>
    <distribution>repo</distribution>
  </license>
</licenses>

You can change values of following properties to control license headers of your source files :

Property

Description

Default value

license.name

Possible values are : "GNU LGPL 3", "AL2", "MIT".

GNU LGPL 3

license.title

 

${project.name}

license.year

 

${project.inceptionYear}

license.owner

 

${project.organization.name}

license.mailto

 

dev@sonar.codehaus.org

Now you can add/update headers of your source files using following command :

Code Block
mvn license:format

Maven plugins versions

The parent pom defines in a set of properties all recommended versions of maven plugins to use.

Note

This isn't recommended but could be useful to use a new version of a plugin not yet available in the parent POM or to workaround a bug by using another version. In all cases don not forget to report to us the change you need. If it's good for one project, it could be useful for others.

Each project/module can override a version of a plugin to use a different from the one defined in parent. For example to change version of sonar-packaging-maven-plugin you can use following code snippet:

Code Block
titlepom.xml
langxml
<properties>
  <version.sonar-packaging.plugin>1.2</version.sonar-packaging.plugin>
</properties>

Profiles

NameIdentifierActivationDescription
Release profilereleaseDeactivated by default. Activated during release. Can be activated with -PreleaseGenerates javadoc artifacts.
Integration testsintegration-testsDeactivated by default. Can be activated with -Pintegration-testsLaunch integration tests from JUnit using the failsafe plugin.

Known Issues

Deployment not possible if you are behind proxy - see SONARPLUGINS-1457

Development

All plugins specified in POM, must be compatible with "maven.min.version" and "java.min.version". This and available plugins updates can be checked with help of versions-maven-plugin.