org.codehaus.mojo.buildhelper
Class ParseVersionMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.buildhelper.ParseVersionMojo
All Implemented Interfaces:
ContextEnabled, Mojo

public class ParseVersionMojo
extends AbstractMojo

Parse a version string and set properties containing the component parts of the version. This mojo sets the following properties:

   [propertyPrefix].majorVersion
   [propertyPrefix].minorVersion
   [propertyPrefix].incrementalVersion
   [propertyPrefix].qualifier
   [propertyPrefix].buildNumber
 
Where the propertyPrefix is the string set in the mojo parameter. Note that the behaviour of the parsing is determined by org.apache.maven.artifact.versioning.DefaultArtifactVersion An osgi compatible version will also be created and made available through the property:
   [propertyPrefix].osgiVersion
 
This version is simply the original version string with the first instance of '-' replaced by '.' For example, 1.0.2-beta-1 will be converted to 1.0.2.beta-1

Since:
1.3
Version:
$Id: ParseVersionMojo.java 9916 2009-06-04 15:21:21Z pgier $
Author:
pgier
Is defined by the goal name:
parse-version
Is bound to the specified phase of the standard build lifecycle:
validate

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ParseVersionMojo()
           
 
Method Summary
 void execute()
          Execute the mojo.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseVersionMojo

public ParseVersionMojo()
Method Detail

execute

public void execute()
             throws MojoExecutionException
Execute the mojo. This sets the version properties on the project.

Throws:
MojoExecutionException - if the plugin execution fails.


Copyright © 2005-2009 Codehaus. All Rights Reserved.