如何使用properties maven plugin:write project properties仅写入指定的属性
我正在尝试使用如何使用properties maven plugin:write project properties仅写入指定的属性,maven,Maven,我正在尝试使用properties-maven-plugin将Git属性写入指定的文件。为此,我使用以下代码: <plugin> <groupId>ru.concerteza.buildnumber</groupId> <artifactId>maven-jgit-buildnumber-plugin</artifactId> <version>1.2.7</version> &l
properties-maven-plugin
将Git属性写入指定的文件。为此,我使用以下代码:
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>1.2.7</version>
<executions>
<execution>
<id>git-buildnumber</id>
<goals>
<goal>extract-buildnumber</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
<!--write project properties to file -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
<configuration>
<outputFile>${project.basedir}/../build-info.tmp</outputFile>
<properties>
<property>
<name>revision</name>
<value>${revision}</value>
</property>
<property>
<name>buildnumber</name>
<value>${buildnumber}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
ru.concerteza.buildnumber
maven jgit buildnumber插件
1.2.7
git buildnumber
提取buildnumber
初始化
org.codehaus.mojo
属性maven插件
1.0-α-2
准备包装
写入项目属性
${project.basedir}/./build-info.tmp
修订
${revision}
建筑编号
${buildnumber}
现在我的问题是:
maven jgit buildnumber插件
中提取修订版和内部版本号git.buildnumber
asbuildnumber
和git.revision
asrevision
buildnumber
有人能给我推荐一下吗?提前谢谢。这正在起作用。。。。通过将其保存在概要文件中并给出命令clean install-profilename-Dversion=16
<plugin>
<groupId>com.keyboardsamurais.maven</groupId>
<artifactId>maven-timestamp-plugin</artifactId>
<version>1.0</version>
<configuration>
<propertyName>date</propertyName>
<timestampPattern>EEE MMM dd hh:mm:ss yyyy Z</timestampPattern>
<timeZone>IST</timeZone>
</configuration>
<executions>
<execution>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>1.2.7</version>
<executions>
<execution>
<id>git-buildnumber</id>
<phase>initialize</phase>
<goals>
<goal>extract-buildnumber</goal>
</goals>
<configuration>
<revisionProperty>revision</revisionProperty>
<buildnumberProperty>version</buildnumberProperty>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>revision</name>
<value>${revision}</value>
</property>
<property>
<name>date</name>
<value>${date}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.internetitem</groupId>
<artifactId>write-properties-file-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>write-properties-file</id>
<phase>install</phase>
<goals>
<goal>write-properties-file</goal>
</goals>
<configuration>
<filename>build-info.tmp</filename>
<outputDirectory>${project.basedir}/../</outputDirectory>
<properties>
<property>
<name>revision</name>
<value>${revision}</value>
</property>
<property>
<name>date</name>
<value>${date}</value>
</property>
<property>
<name>version</name>
<value>${version}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
com.keyboardsamurais.maven
maven时间戳插件
1
日期
EEE MMM dd hh:mm:ss yyyy Z
IST
创造
ru.concerteza.buildnumber
maven jgit buildnumber插件
1.2.7
git buildnumber
初始化
提取buildnumber
修订
版本
org.codehaus.mojo
属性maven插件
1.0.0
设置系统属性
修订
${revision}
日期
${date}
com.internetitem
写属性文件maven插件
1.0.1
写入属性文件
安装
写入属性文件
build-info.tmp
${project.basedir}//
修订
${revision}
日期
${date}
版本
${version}
这正在工作。。。。通过将其保存在概要文件中并给出命令clean install-profilename-Dversion=16
<plugin>
<groupId>com.keyboardsamurais.maven</groupId>
<artifactId>maven-timestamp-plugin</artifactId>
<version>1.0</version>
<configuration>
<propertyName>date</propertyName>
<timestampPattern>EEE MMM dd hh:mm:ss yyyy Z</timestampPattern>
<timeZone>IST</timeZone>
</configuration>
<executions>
<execution>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>1.2.7</version>
<executions>
<execution>
<id>git-buildnumber</id>
<phase>initialize</phase>
<goals>
<goal>extract-buildnumber</goal>
</goals>
<configuration>
<revisionProperty>revision</revisionProperty>
<buildnumberProperty>version</buildnumberProperty>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>revision</name>
<value>${revision}</value>
</property>
<property>
<name>date</name>
<value>${date}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.internetitem</groupId>
<artifactId>write-properties-file-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>write-properties-file</id>
<phase>install</phase>
<goals>
<goal>write-properties-file</goal>
</goals>
<configuration>
<filename>build-info.tmp</filename>
<outputDirectory>${project.basedir}/../</outputDirectory>
<properties>
<property>
<name>revision</name>
<value>${revision}</value>
</property>
<property>
<name>date</name>
<value>${date}</value>
</property>
<property>
<name>version</name>
<value>${version}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
com.keyboardsamurais.maven
maven时间戳插件
1
日期
EEE MMM dd hh:mm:ss yyyy Z
IST
创造
ru.concerteza.buildnumber
maven jgit buildnumber插件
1.2.7
git buildnumber
初始化
提取buildnumber
修订
版本
org.codehaus.mojo
属性maven插件
1.0.0
设置系统属性
修订
${revision}
日期