如何获取工件的最新版本号并将其替换为目标文件?

时间:2014-10-06 19:16:25

标签: maven tycho

我正在使用Tycho附加功能使用目标文件镜像存储库。事情是在我的.target文件中我有一些版本0.0.0的可安装单元意味着我想获得最新版本,但是如果我想运行一个脚本来冻结版本,我的意思是如果现在可以使用最新版本明确地将该数字放在.target文件中,以便将来我仍然会镜像我现在的版本。

<plugin>
    <groupId>org.jboss.tools.tycho-plugins</groupId>
    <artifactId>target-platform-utils</artifactId>
    <version>0.21.0</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>mirror-target-to-repo</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <sourceTargetFile>${target-platform-file}</sourceTargetFile>
        <includeSources>false</includeSources>
        <outputRepository>${basedir}/target/repository</outputRepository>
    </configuration>
</plugin>

1 个答案:

答案 0 :(得分:0)

此任务有一个专用插件,您可以从命令行调用:

mvn org.eclipse.tycho.extras:tycho-version-bump-plugin:0.22.0:update-target -Dtarget=path/to/targetfile.target

此命令需要Maven / Tycho项目,因此您需要在父pom.xml的目录中启动它(或使用-f指定该文件的路径)。此外,命令中的版本号需要与项目中配置的Tycho版本匹配。

另请注意,该命令会将所有工件版本更新为最新的可用版本,而不仅仅是版本为0.0.0的版本。如果您只想更新某些版本,请保留目标文件的备份,然后使用您选择的差异工具选择所需的更改。

相关问题