简体   繁体   中英

How to add SVN revision number to MANIFEST file?

I am trying to add svn revision number to MANIFEST file. I have this in my root pom.xml:

<plugin>
  <groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
  <artifactId>svn-revision-number-maven-plugin</artifactId>
  <version>1.13</version>
  <executions>
    <execution>
      <goals>
        <goal>revision</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <entries>
      <entry>
        <prefix>svn</prefix> <!-- create the ${svn.revision} -->
      </entry>
    </entries>
  </configuration>
     <dependencies>
    <dependency>
      <groupId>org.tmatesoft.svnkit</groupId>
      <artifactId>svnkit</artifactId>
      <version>1.7.4-v1</version>
    </dependency>
    <dependency>
      <groupId>org.tmatesoft.sqljet</groupId>
      <artifactId>sqljet</artifactId>
      <version>1.1.9</version>
    </dependency>
  </dependencies>
</plugin> 

And I'm trying to add svn revision in my ear pom.xml:

<archive>
    <manifestEntries>
    <Specification-Title>${project.name}</Specification-Title>
    <Specification-Version>${svn.revision}</Specification-Version>
    <Implementation-Version>${build.number}</Implementation-Version>
    </manifestEntries>
</archive>

I'm not getting any version in MANIFEST file. Any ideas of what I'm doing wrong?

Manifest-Version: 1.0
Implementation-Version: 273
Built-By: adelina.dimachi
Build-Jdk: 1.6.0_45
Specification-Title: MyProjectName
Created-By: Apache Maven 3.2.1
**Specification-Version:** 
Archiver-Version: Plexus Archiver

I don't know the maven-svn-revision-number-plugin but I've successfully used the maven-jar-plugin for this in the past:

https://maven.apache.org/plugin-developers/cookbook/add-svn-revision-to-manifest.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM