如何将SVN版本号添加到MANIFEST文件中? [英] How to add SVN revision number to MANIFEST file?

查看:110
本文介绍了如何将SVN版本号添加到MANIFEST文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将svn修订号添加到MANIFEST文件中.我的根目录为pom.xml:

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> 

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

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

推荐答案

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

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

这篇关于如何将SVN版本号添加到MANIFEST文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆