我在我的 Android 应用程序中添加 svn 修订号时遇到问题。我在谷歌做了一项研究,我发现了这个:http ://ballardhack.wordpress.com/2010/09/28/subversion-revision-in-android-app-version-with-eclipse/ 但我不想在 Eclipse 中构建这个项目。我通过 'mvn clean install android:deploy' 编译项目
我还发现了这个: http: //maven-svn-revision-number-plugin.googlecode.com/svn/site/examples/resource_filtering.html
我在 /res/raw 中创建文件“revision.txt”并在 pom.xml 中添加:
<build>
<finalName>${project.artifactId}</finalName>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>res/raw/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
<artifactId>svn-revision-number-maven-plugin</artifactId>
<version>1.13</version> <!-- please use the latest version -->
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<entries>
<entry>
<prefix>prefix</prefix>
</entry>
</entries>
</configuration>
</plugin>
但它不起作用!构建后(mvn clean install)我打开文件'revision.txt',我有这个:
repository = ${prefix.repository}
path = ${prefix.path}
revision = ${prefix.revision}
mixedRevisions = ${prefix.mixedRevisions}
committedRevision = ${prefix.committedRevision}
committedDate = ${prefix.committedDate}
status = ${prefix.status}
specialStatus = ${prefix.specialStatus}
如何使用 Maven SVN 修订号插件将修订号归档?