您好,我想在“关于”部分添加 RCP 应用程序的当前版本(在父 pom 中手动定义),这意味着我需要在运行时访问它。对于 pomless Maven tycho 构建来说,默认的方法是什么?我尝试了properties-maven-plugin,但在将属性文件与我的构建结合起来时遇到问题。所以我想必须有一种更方便的方法。谢谢您的帮助!
maven-resources-plugin
将版本信息添加到 about.mappings
文件中:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>process-about.mappings</id>
<phase>prepare-package</phase>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>about.mappings</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
<goals>
<goal>copy-resources</goal>
</goals>
</execution>
</executions>
</plugin>