求教:Eclipse staging目录下p2仓库构建方及pom.xml配置方式
Eclipse EPP Staging仓库构建主体与pom.xml配置解析
构建主体说明
Eclipse EPP的staging仓库(比如2024-12版本)是由Eclipse Packaging Project (EPP) 的发布工程(releng模块)负责构建的,核心依赖Eclipse Tycho插件+Maven的组合完成p2仓库的集成与部署:
- 构建的核心载体是EPP的releng项目,它负责整合Eclipse核心组件、官方插件及第三方适配组件,统一构建成完整的p2仓库产物
- 构建流程运行在Eclipse Foundation的CI基础设施(Jenkins集群)上,触发时机为版本发布周期内的预构建阶段,产物先部署到staging目录,用于发布前的功能验证、兼容性测试,确认无误后才会同步到正式下载仓库
pom.xml关键配置写法
1. 继承EPP父pom(或基础Tycho配置)
首先需要继承EPP的官方父pom,以复用标准化的构建配置:
<parent> <groupId>org.eclipse.epp</groupId> <artifactId>epp-parent</artifactId> <version>2024-12-SNAPSHOT</version> <relativePath>../epp-parent</relativePath> </parent>
2. Tycho p2仓库生成配置
通过tycho-p2-repository-plugin插件生成符合p2规范的staging仓库:
<build> <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-repository-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <id>assemble-staging-repo</id> <phase>package</phase> <goals> <goal>assemble-repository</goal> </goals> </execution> </executions> <configuration> <includeAllDependencies>true</includeAllDependencies> <compress>true</compress> <repositoryName>Eclipse ${release-version} Staging Repository</repositoryName> <!-- 本地构建时的输出目录 --> <outputDirectory>${project.build.directory}/staging-repo</outputDirectory> </configuration> </plugin> </plugins> </build>
3. Staging仓库部署配置
添加部署配置,将生成的p2仓库推送到Eclipse的staging服务器:
<plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-repository-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <id>deploy-staging-repo</id> <phase>deploy</phase> <goals> <goal>deploy-repository</goal> </goals> <configuration> <repositoryUrl>https://download.eclipse.org/staging/${release-version}/</repositoryUrl> <publishArtifacts>true</publishArtifacts> <!-- CI环境中需配置服务器认证信息 --> </configuration> </execution> </executions> </plugin>
4. 版本与Profile配置
通过Maven Profile区分不同发布版本的配置:
<profiles> <profile> <id>2024-12</id> <properties> <release-version>2024-12</release-version> <tycho-version>4.0.0</tycho-version> <eclipse-platform-version>4.31.0-SNAPSHOT</eclipse-platform-version> </properties> </profile> </profiles>
补充说明
staging仓库的核心作用是作为发布前的预验证环境,所有组件的集成问题、兼容性问题都会在这个阶段暴露,验证通过后,CI流水线会将staging仓库的内容同步到正式的Eclipse下载仓库中。
内容的提问来源于stack exchange,提问作者Bourbon_7
相关产品推荐
相关产品推荐

