0

I'm using Tycho extras to mirror repositories using a target file. The thing is in my .target file I have some installable units with version 0.0.0 meaning I want to get the latest version, but what if I want to run a script to freeze the version, I mean getting the latest one available now and explicitly put the number in the .target file so in the future I'll still mirror the same version I have now.

<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>
oberlies
  • 11,503
  • 4
  • 63
  • 110
martinc
  • 11
  • 4

1 Answers1

0

There is a dedicated plug-in for this task, which you can call from the command line:

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

This command needs a Maven/Tycho project, so you need to start it in the directory of your parent pom.xml (or specify the path to that file with -f). Also, the version number in the command needs to match the Tycho version configured in your project.

Also note that the command updates all artifact versions to the latest available version, not only the ones which had a 0.0.0 version literal. If you just want to update some versions, keep a backup of your target file and then pick the changes you want with a diff tool of your choice.

oberlies
  • 11,503
  • 4
  • 63
  • 110