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
     
    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.factory.ArtifactFactory artifactFactory  
      private org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
      The artifact metadata source to use.
      private org.apache.maven.artifact.repository.ArtifactRepository localRepository  
      private java.lang.String propertyPrefix
      Prefix string to use for the set of version properties.
      private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories  
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • artifactMetadataSource

        @Component
        private org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
        The artifact metadata source to use.
      • artifactFactory

        @Component
        private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
      • localRepository

        @Parameter(defaultValue="${localRepository}",
                   readonly=true)
        private org.apache.maven.artifact.repository.ArtifactRepository localRepository
      • remoteArtifactRepositories

        @Parameter(defaultValue="${project.remoteArtifactRepositories}",
                   readonly=true)
        private java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteArtifactRepositories
      • 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()