org.codehaus.mojo.properties
Class ParseVersionPropertiesMojo

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

public class ParseVersionPropertiesMojo
extends org.apache.maven.plugin.AbstractMojo

Parse version number properties into [major].[minor].[incremental].[qualifier] and [trimmed]. The version parsing logic is crudely simple. It splits the version string into tokens using both "." and "-" as delimiters. It assumes the first token is "major", the second token is "minor" the third token is "incremental" and any tokens after that are "qualifier". "SNAPSHOT" is always omitted from qualifier. [trimmed] is the full version minus "-SNAPSHOT"


Field Summary
static String MAVEN_SNAPSHOT_TOKEN
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ParseVersionPropertiesMojo()
           
 
Method Summary
 void execute()
           
 String[] getProperties()
           
protected  String getProperty(String key)
           
protected  String getQualifier(String[] tokens)
           
 boolean isSilent()
           
protected  Version parseVersion(String s)
           
protected  void setProjectProperty(String key, String suffix, String value, Properties props)
           
 void setProperties(String[] properties)
           
 void setSilent(boolean silent)
           
protected  String trimSnapshot(String version)
           
 
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
 

Field Detail

MAVEN_SNAPSHOT_TOKEN

public static final String MAVEN_SNAPSHOT_TOKEN
See Also:
Constant Field Values
Constructor Detail

ParseVersionPropertiesMojo

public ParseVersionPropertiesMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

trimSnapshot

protected String trimSnapshot(String version)

setProjectProperty

protected void setProjectProperty(String key,
                                  String suffix,
                                  String value,
                                  Properties props)

parseVersion

protected Version parseVersion(String s)

getQualifier

protected String getQualifier(String[] tokens)

getProperty

protected String getProperty(String key)

getProperties

public String[] getProperties()

setProperties

public void setProperties(String[] properties)

isSilent

public boolean isSilent()

setSilent

public void setSilent(boolean silent)


Copyright © 2009-2013 The Kuali Foundation. All Rights Reserved.