首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为RAP和RCP调味功能构建单个更新站点

为RAP和RCP调味功能构建单个更新站点
EN

Stack Overflow用户
提问于 2017-12-14 08:42:17
回答 1查看 215关注 0票数 1

我构建了一个单一来源的RCP/RAP Eclipse功能项目,该项目使用maven配置文件来构建RAP或RCP包、片段和特性。

这是相当不错的。如果我将更新站点项目作为模块包含在上面构建的父POM中,那么我也可以使用“”(或“eclipse-存储库”)打包来轻松地构建一个特定于平台的更新站点。

不过,我在想,有没有办法

  1. 构建RCP目标平台>发布到本地回购
  2. 构建RAP目标平台>发布到本地回购
  3. 运行构建RCP (从步骤1到目标平台)>发布到本地回购
  4. 运行RAP构建(步骤2中的目标平台)>发布到本地回购
  5. 只为更新站点运行构建,包括RAP和RCP的特性(不编译任何东西,只是从1+2组装)

我可以成功地执行步骤1-4,但不能执行步骤5,因为Tycho试图用不同的限定符解析category.xml引用的特性。

如果我正确地理解了更新站点/p2存储库,那么应该可以提供各种类型的构件/包/特性,对吗?

我如何解决这个问题,或者更确切地说:我可以有一个tycho构建,它可以以相同的限定符连续运行上面的构建步骤吗?

增编:这个现有问题也是这样,建议“将(特性) Tycho项目安装到.本地Maven存储库”。这实际上是我在运行1和2时所做的事情,在彼此之后,专门为两者提供相同的本地回购。但是,由于限定符是不同的(两个不同的反应堆构建),所以3.无法从其中提取引用的工件。在同一个反应堆里运行所有的东西对我来说都是很好的,但我认为这是不可能的,因为有不同的目标平台。

我认为那里的解决方案非常接近我所需要的,但我不明白我的category.xml (或site.xml)和POM中的额外依赖关系是如何协同工作的。我是否必须完全放弃category.xml并重新分配eclipse-repository POM中的所有依赖项?

我的身材大致如下:

foo.releng/pom.xml (父级POM)

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <modelVersion>4.0.0</modelVersion>
    <groupId>net.bar</groupId>
    <artifactId>foo</artifactId>
    <version>0.31.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <tycho-version>1.0.0</tycho-version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jacoco-version>0.7.6.201602180812</jacoco-version>
    </properties>

    <modules>
        <module>../foo.plugin1</module>
        <module>../foo.plugin2</module>
        <!-- feature module is built depending on target platform, see below -->
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <!-- target and dependency-resolution are RAP/RCP dependent, see profiles below -->
                    <resolver>p2</resolver>
                    <environments>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86_64</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>target-rcp</id>
            <activation>
                <property>
                    <name>target.platform</name>
                    <value>rcp</value>
                </property>
            </activation>
            <modules>
                <module>../foo.fragment.rcp</module>
                <module>../foo.feature.rcp</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.tycho</groupId>
                        <artifactId>target-platform-configuration</artifactId>
                        <version>${tycho-version}</version>
                        <configuration>
                            <target>
                                <artifact>
                                    <groupId>net.bar</groupId>
                                    <artifactId>net.bar.foo.target.rcp</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>rcp</classifier>
                                </artifact>
                            </target>
                            <dependency-resolution>
                                <optionalDependencies>ignore</optionalDependencies>
                                <extraRequirements>
                                    <requirement>
                                        <type>eclipse-plugin</type>
                                        <id>org.eclipse.ui</id>
                                        <versionRange>0.0.0</versionRange>
                                    </requirement>

                                    ... more rcp-only dependencies

                                </extraRequirements>
                            </dependency-resolution>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>target-rap</id>
            <activation>
                <property>
                    <name>target.platform</name>
                    <value>rap</value>
                </property>
            </activation>
            <modules>
                <module>../foo.fragment.rap</module>
                <module>../foo.feature.rap</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.tycho</groupId>
                        <artifactId>target-platform-configuration</artifactId>
                        <version>${tycho-version}</version>
                        <configuration>

                        ... same as for RCP above, but for RAP

                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

A这是updatesite/category.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature url="features/net.bar.foo.feature.rcp_0.31.0.qualifier.jar" id="net.bar.foo.feature.rcp" version="0.31.0.qualifier">
      <category name="net.bar.rcp"/>
   </feature>
   <feature url="features/net.bar.foo.feature.rap_0.31.0.qualifier.jar" id="net.bar.foo.feature.rap" version="0.31.0.qualifier">
      <category name="net.bar.rap"/>
   </feature>
   <category-def name="net.bar.rcp" label="RCP">
      <description>
         RCP Platform Features
      </description>
   </category-def>
   <category-def name="net.bar.rap" label="RAP">
      <description>
         RAP Platform Features
      </description>
   </category-def>
</site>

updatesite/pom.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <version>0.31.0-SNAPSHOT</version>
        <relativePath>../foo.releng/pom.xml</relativePath>
        <artifactId>foo</artifactId>
        <groupId>net.bar</groupId>
    </parent>

    <artifactId>net.bar.foo.updatesite</artifactId>
    <packaging>eclipse-repository</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-packaging-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <archiveSite>true</archiveSite>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-14 13:57:01

这个问题涉及一个非常类似的问题,它帮助我找到了一个解决方案。

我成功地将tycho-packaging-plugin配置为一个可复制时间戳限定符

通过对所有连续构建使用常量版本限定符(基于git提交ID),最终的存储库构建可以在本地maven repo中正确地解析所有引用的特性包。

在此调整之后,以下构建将顺利完成,并发布RAP和RCP特性:

代码语言:javascript
复制
# build rcp target

cd foo/net.bar.foo.target.rcp
mvn clean install -Dmaven.repo.local=../../m2

# build rap target

cd ../net.bar.foo.target.rap
mvn clean install -Dmaven.repo.local=../../m2

# build features and plugins for rcp, then for rap

cd ../net.bar.foo.releng
mvn clean install -Dmaven.repo.local=../../m2 -Dtarget.platform=rcp
mvn clean install -Dmaven.repo.local=../../m2 -Dtarget.platform=rap

# build p2 repository 

cd ../net.bar.foo.updatesite
mvn clean install -Dmaven.repo.local=../../m2 -Dtarget.platform=rap

哇……

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47809122

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档