简体   繁体   English

如何将SVN版本号添加到MANIFEST文件中?

[英]How to add SVN revision number to MANIFEST file?

I am trying to add svn revision number to MANIFEST file. 我正在尝试将svn版本号添加到清单文件中。 I have this in my root pom.xml: 我的根目录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: 我试图在我的耳朵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>

I'm not getting any version in MANIFEST file. 我在MANIFEST文件中没有任何版本。 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: 我不知道maven-svn-revision-number-plugin,但是过去我已经成功使用了maven-jar-plugin:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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