Maven Plugin for Semantic Project Versioning

I am looking for a maven plugin that will help me manage the names and version codes of each assembly created in our CI environment. Something that can attach a prefix to the main version code or even update it (without changing pom.xml). For example:

project version: 2.0.1
git/svn revision: 2342334

jar output: name-2.0.1-2342334.jar
maven repo: ../path/to/local/maven/repo/<package path>/2.0.1-2342334/

Basic requirements for this plugin:

  • Must be in the Maven repository (this means that pom.xmlno additional settings are required to add this plugin to mine and run maven)
  • No need to edit pom every time it is applied
  • The configuration file would be great, so I could manage the version control process
  • Must be able to edit the metadata of the output file (so the version will be applied as if it were written to the file pom.xmlin the first place)

So far I have only found maven-buildmetadata-pluging , but unfortunately this is not in Maven Repo, so I am stuck. Any help would be great.

+4
source share
3 answers

If you change the version of your artifact, pom should reflect this change, otherwise it will not play.

- (, , ), pom. .

, pom, . , : pom, .

, , maven-buildmetadata, , maven (, build-helper-maven-plugin, buildnumber-maven-plugin).

SCM buildnumber-maven-plugin, , ​​ SCM (SVN GIT ),

, pom, versions-maven-plugin, maven-release-plugin, pom .

, (, , , ) .. , , buildNumber buildnumber-maven-plugin:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <version>${maven-jar-plugin.version}</version>
      <configuration>
        <archive>
          <addMavenDescriptor>true</addMavenDescriptor>
          <index>true</index>
          <manifest>
            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
          </manifest>
          <manifestEntries>
            <artifactId>${project.artifactId}</artifactId>
            <groupId>${project.groupId}</groupId>
            <version>${project.version}</version>
            <buildNumber>${buildNumber}</buildNumber>
          </manifestEntries>
        </archive>
      </configuration>
    </plugin>

, , Maven, , , , Artifactory Nexus, .

+2

maven , Nexus Artifactory. Artifactory cloud version ( ...), . BTW - Apache , .,

: .

- svn info ( ) . .

+2

( 5 ), Buildmetadata Maven Maven, ( 2013 ). , , :

  1. com.redhat.rcm.maven.plugin: buildmetadata-Maven-
  2. de.smartics.maven.plugin: buildmetadata-Maven-

, maven-buildmetadata-plugin buildmetadata-maven-plugin - .

"" Smartics. , , , , Red Hat. , , , , , , , . ;-)

GitHub:

  1. - /buildmetadata-Maven-
  2. smartics/buildmetadata-Maven-
0

All Articles