【问题标题】:How to add SVN revision number to MANIFEST file?如何将 SVN 修订号添加到 MANIFEST 文件?
【发布时间】:2015-10-09 04:57:32
【问题描述】:

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

【问题讨论】:

    标签: java maven tortoisesvn version manifest


    【解决方案1】:

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

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

    【讨论】:

    • 我也试过这个插件,但我得到这个错误:[ERROR] Provider message: [ERROR] The svn command failed。 [ERROR] 命令输出:[ERROR] 'svn' 不是内部或外部命令、可运行程序或批处理文件。我在 scm 标签之间设置了 svn 的 url。我还需要做什么吗?
    • 似乎 SVN 不是您的 PATH 的一部分。
    猜你喜欢
    • 1970-01-01
    • 2012-11-29
    • 1970-01-01
    • 1970-01-01
    • 2011-04-24
    • 1970-01-01
    • 1970-01-01
    • 2020-05-30
    • 2015-12-30
    相关资源
    最近更新 更多