Package com.sun.enterprise.module.maven
Class OsgiVersionMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.sun.enterprise.module.maven.OsgiVersionMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
public class OsgiVersionMojo extends org.apache.maven.plugin.AbstractMojo
Converts the project version into the OSGi format and set that to "project.osgi.version" property. It can be configured to drop certain portions from the version. SeedropVersionComponent
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Version.COMPONENT
dropVersionComponent
Flag used to determine what components of the version will be used in OSGi version.protected org.apache.maven.project.MavenProject
project
The maven project.protected java.lang.String
versionPropertyName
-
Constructor Summary
Constructors Constructor Description OsgiVersionMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
-
-
-
Field Detail
-
project
protected org.apache.maven.project.MavenProject project
The maven project.
-
dropVersionComponent
protected Version.COMPONENT dropVersionComponent
Flag used to determine what components of the version will be used in OSGi version. An OSGi version has four parts as shown below: major.minor.micro.qualifer. It is not always desirable to use all four parts while exporting packages. In fact, maven version and OSGi version behave just opposite during version comparison as shown below: a maven version 1.2.3-SNAPSHOT is mapped to OSGi version 1.2.3.SNAPSHOT. In maven, 1.2.3 > 1.2.3-SNAPSHOT, but in OSGi, 1.2.3 < 1.2.3.SNAPSHOT. So, it is highly desirable to drop qualifier while computing the version. Instead of hardcoding the policy, we let user tell us what portions will be used in the OSGi version. If they ask us to drop minor, then only major will be used. Similarly, if they ask us to drop qualifier, then major, minor and micro portions will be used.
-
versionPropertyName
protected java.lang.String versionPropertyName
-
-