Eclipse 插件不维护 Maven 多模块的顺序

发布于 2024-12-28 18:22:03 字数 2169 浏览 3 评论 0原文

我们有很多 Eclipse 插件项目、功能和更新站点。我们创建了一个主 pom,在其中定义模块:

<modules>
    <module>bundles/b1</module>
    <module>features/f1</module>
    <module>p2/site1</module>
    <module>bundles/b2</module>
</modules>

我们希望保留此顺序并按照 使用多个模块的指南 根据上面的链接,我们假设顺序将按照模块元素的列出顺序保留。

我们的要求: site1 生成 site_ assembly.zip。我们想要将这个 zip 文件打包成一个包,这就是“b2”包的作用。

我们的观察:

  1. 在多模块构建开始时打印的 Maven 反应器顺序是正确的,但是每个模块的构建都是分叉的。
  2. 因为 (1) 捆绑包 b2 在 site1 项目构建之前构建,并且能够生成站点程序集 zip。
  3. 我们尝试将“b2”的 pom.xml 中的依赖项添加到 site1,但构建失败,因为它尝试先构建 b2,而 b2 依赖于 site1,而 site1 到目前为止尚未构建。
  4. 当我们对 osgi 片段进行单元测试时,我们观察到了相同的行为。按照我们明确指定主机在测试片段之前的顺序,但是当调用 Maven 构建时,它总是在主机之前构建片段,并且曾经失败。

master pom 中定义的插件:

 <plugin>
            <!-- enable tycho build extension -->
            <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>
                <disableP2Mirrors>true</disableP2Mirrors>
                <resolver>p2</resolver>
                <target>
                    <artifact>
                        <groupId>com.x.y</groupId>
                        <artifactId>p2.build.target</artifactId>
                        <version>${project.version}</version>
                        <classifier>x</classifier>
                    </artifact>
                </target>
            </configuration>
        </plugin>

我们不确定 maven-tycho-plugin 是否会干扰反应器顺序,因此我们将不胜感激。

We have a bunch of eclipse plugin projects, features and update sites. We have created a master pom where we define the modules:

<modules>
    <module>bundles/b1</module>
    <module>features/f1</module>
    <module>p2/site1</module>
    <module>bundles/b2</module>
</modules>

We wanted to preserve this order and as per Guide to working with Multiple Modules
As per the link above we assumed that the order will be preserved as per the order in which the module elements were listed.

Our requirement:
site1 produces a site_assembly.zip. We wanted to take this zip file and wrap into around into a bundle which is what "b2" bundle does.

Our observation:

  1. Maven reactor order which is printed at the beginning of the multi-module build is proper, however the build for every module is forked.
  2. Because of (1) the bundle b2 get built before the site1 project is build and is able to produce a site assembly zip.
  3. We tried adding a dependency in "b2"'s pom.xml to site1 but the build failed as it tries to build b2 first which has dependency on site1 which has not been built till now.
  4. We observed the same behavior when we had unit test as osgi fragment. In the order we clearly specified that the host comes before the test fragment but when the maven build is invoked then it always built the fragment before the host and it used to fail.

Plugins that are defined in master pom:

 <plugin>
            <!-- enable tycho build extension -->
            <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>
                <disableP2Mirrors>true</disableP2Mirrors>
                <resolver>p2</resolver>
                <target>
                    <artifact>
                        <groupId>com.x.y</groupId>
                        <artifactId>p2.build.target</artifactId>
                        <version>${project.version}</version>
                        <classifier>x</classifier>
                    </artifact>
                </target>
            </configuration>
        </plugin>

We are not sure if maven-tycho-plugin interferes with the reactor order, so any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初心未许 2025-01-04 18:22:03

Tycho 解析 Eclipse 描述符文件(MANIFEST.MF、feature.xml 等)的依赖关系,并对模块重新排序,以便首先构建所需的工件。

Tycho resolves the dependencies from the Eclipse descriptor files (MANIFEST.MF, feature.xml, etc.) and re-orders the modules so that required artifacts are built first.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文