Class ReleasedVersionMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="released-version",
          defaultPhase=VALIDATE,
          threadSafe=true)
    public class ReleasedVersionMojo
    extends AbstractDefinePropertyMojo
    Resolve the latest released version of this project. This mojo sets the following properties:
       [propertyPrefix].version
       [propertyPrefix].majorVersion
       [propertyPrefix].minorVersion
       [propertyPrefix].incrementalVersion
       [propertyPrefix].buildNumber
       [propertyPrefix].qualifier
     
    Where the propertyPrefix is the string set in the mojo parameter.
    Since:
    1.6
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager  
      private java.lang.String propertyPrefix
      Prefix string to use for the set of version properties.
      private org.eclipse.aether.RepositorySystemSession repoSession  
      private org.eclipse.aether.RepositorySystem repoSystem
      The artifact metadata source to use.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • repoSystem

        @Component
        private org.eclipse.aether.RepositorySystem repoSystem
        The artifact metadata source to use.
      • artifactHandlerManager

        @Component
        private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
      • repoSession

        @Parameter(defaultValue="${repositorySystemSession}",
                   readonly=true)
        private org.eclipse.aether.RepositorySystemSession repoSession
      • propertyPrefix

        @Parameter(defaultValue="releasedVersion")
        private java.lang.String propertyPrefix
        Prefix string to use for the set of version properties.
    • Constructor Detail

      • ReleasedVersionMojo

        public ReleasedVersionMojo()
    • Method Detail

      • defineVersionProperty

        private void defineVersionProperty​(java.lang.String name,
                                           java.lang.String value)
      • defineVersionProperty

        private void defineVersionProperty​(java.lang.String name,
                                           int value)
      • execute

        public void execute()