public class ParseVersionMojo
extends org.apache.maven.plugin.AbstractMojo
[propertyPrefix].majorVersion [propertyPrefix].minorVersion [propertyPrefix].incrementalVersion [propertyPrefix].qualifier [propertyPrefix].buildNumberWhere 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].osgiVersionThis 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
Constructor and Description |
---|
ParseVersionMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Execute the mojo.
|
String |
getOsgiVersion(org.apache.maven.artifact.versioning.ArtifactVersion version)
Make an osgi compatible version String from an ArtifactVersion
|
void |
parseVersion(String version,
Properties props)
Parse a version String and add the components to a properties object.
|
void |
setPropertyPrefix(String prefix) |
public void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- if the plugin execution fails.public void parseVersion(String version, Properties props)
version
- props
- public void setPropertyPrefix(String prefix)
public String getOsgiVersion(org.apache.maven.artifact.versioning.ArtifactVersion version)
version
- Copyright © 2005-2021 Codehaus. All Rights Reserved.