Renaming ZIP files created by tycho-p2-director-plugin

tycho-p2-director-plugin does not seem to be able to add the version number to the final ZIP file names. he produces

myproduct-win32.win32.x86.zip myproduct-macosx.cocoa.x86.zip myproduct-linux.gtk.x86.zip 

while i would like to have

 myproduct-1.6.0-win32.zip myproduct-1.6.0-linux32.zip myproduct-1.6.0-macos.zip 

What is the best way? rename with maven-antrun-plugin? rename with maven resource plugin? anything alice?

+4
source share
3 answers

The following is what I do in my project,

  <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-director-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <id>materialize-products</id> <goals> <goal>materialize-products</goal> </goals> <configuration> <installFeatures>false</installFeatures> <profile>Installer</profile> </configuration> </execution> <execution> <id>archive-products</id> <goals> <goal>archive-products</goal> </goals> </execution> </executions> </plugin> <!-- ANT actions --> <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <!-- Rename the ZIP files --> <execution> <id>update-zip-files</id> <phase>install</phase> <configuration> <target> <!-- Rename the products --> <move verbose="true" todir="${project.build.directory}/products"> <mapper type="regexp" from="^(Installer-)(.*)$$" to="\1N-${maven.build.timestamp}-\2" /> <fileset dir="${project.build.directory}/products"> <include name="*.zip" /> </fileset> </move> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> 
+1
source

From the bug report at https://bugs.eclipse.org/bugs/show_bug.cgi?id=357503 it seems that they added the ability to change the zip file name directly from Tycho 0.14.0. I use the following for my tycho-p2-director-plugin block.

 <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-director-plugin</artifactId> <version>0.16.0</version> <executions> <execution> <id>materialize-products</id> <goals> <goal>materialize-products</goal> </goals> </execution> <execution> <id>archive-products</id> <goals> <goal>archive-products</goal> </goals> </execution> </executions> <configuration> <products> <product> <id>MY_PRODUCT_ID</id> <archiveFileName>MyProduct-${project.version}</archiveFileName> </product> </products> </configuration> </plugin> 

The key bit is at the end of the <configuration> section, where you can specify the zip file prefix using the <archiveFileName> . The file suffix is ​​still -<os>.<ws>.<arch>.<archiveExtension> , as you might expect.

+8
source

The answer is independent of Tycho:

 <build> <finalName>myproduct</finalName> </build> 
-1
source

Source: https://habr.com/ru/post/1387299/


All Articles