You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Tycho构建Eclipse RCP应用时,如何自定义生成的.zip文件名?

修改Tycho构建生成的RCP压缩包文件名

你可以通过配置Tycho的tycho-p2-director-plugin插件,自定义生成的压缩包文件名,分两种场景配置:

场景1:生成固定名称(如MyProduct.zip)

在产品模块的pom.xml中,找到tycho-p2-director-plugin的执行配置,为archive-products阶段添加archiveFileName参数:

<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>
        </execution>
        <execution>
            <id>archive-products</id>
            <goals>
                <goal>archive-products</goal>
            </goals>
            <configuration>
                <archiveFileName>MyProduct.zip</archiveFileName>
            </configuration>
        </execution>
    </executions>
</plugin>

场景2:保留平台后缀(如MyProduct-win32.win32.x86_64.zip)

利用Tycho内置的${osgi.os}、${osgi.ws}、${osgi.arch}变量拼接文件名,配置如下:

<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>
        </execution>
        <execution>
            <id>archive-products</id>
            <goals>
                <goal>archive-products</goal>
            </goals>
            <configuration>
                <archiveFileName>MyProduct-${osgi.os}.${osgi.ws}.${osgi.arch}.zip</archiveFileName>
            </configuration>
        </execution>
    </executions>
</plugin>

配置完成后重新执行Tycho构建,即可生成符合要求的压缩包文件名。

内容的提问来源于stack exchange,提问作者Jarvis Yu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 01:05:16