如何将SVN修订号添加到MANIFEST文件?

时间:2015-07-20 06:45:56

标签: java maven tortoisesvn version manifest

我正在尝试将svn修订号添加到MANIFEST文件中。我在我的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> 

我正在尝试在我的耳朵pom.xml中添加svn修订版:

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

我没有在MANIFEST文件中获得任何版本。对我做错了什么想法?

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

1 个答案:

答案 0 :(得分:1)

我不知道maven-svn-revision-number-plugin,但我过去成功地使用了maven-jar-plugin:

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