Ale*_*lex 5 eclipse maven-3 tycho
tycho-p2-director-plugin似乎没有办法在最终的ZIP文件名中添加版本号.它产生
myproduct-win32.win32.x86.zip
myproduct-macosx.cocoa.x86.zip
myproduct-linux.gtk.x86.zip
Run Code Online (Sandbox Code Playgroud)
虽然我想拥有
myproduct-1.6.0-win32.zip
myproduct-1.6.0-linux32.zip
myproduct-1.6.0-macos.zip
Run Code Online (Sandbox Code Playgroud)
什么是最好的方式?不知何故用maven-antrun-plugin重命名?用maven资源插件重命名?什么东西?
从https://bugs.eclipse.org/bugs/show_bug.cgi?id=357503的错误报告中可以看出,他们已经添加了直接从Tycho 0.14.0更改zip文件的文件名的功能.我正在使用以下内容作为我的tycho-p2-director-plugin块.
<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>
Run Code Online (Sandbox Code Playgroud)
关键位在<configuration>末尾的部分中,您可以使用<archiveFileName>标记指定zip文件的前缀.-<os>.<ws>.<arch>.<archiveExtension>人们可能希望,文件的后缀仍然是.
以下是我在项目中所做的事情,
<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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2330 次 |
| 最近记录: |