p2-maven-plugin - “缺少要求” “需要”java.package; javax.interceptor [1.2.0,2.0.0)'但找不到”

发布于 2025-01-13 20:43:12 字数 4440 浏览 3 评论 0原文

我有一个大型 Eclipse RCP 应用程序,其中有很多传递依赖项。

目前,这些是手动复制到类路径中的,但这是我想避免的重大管理开销,而是想使用 p2-maven-插件

我根据提供的示例创建了一个简单的 pom.xml,它导入了 Hibernate 依赖项:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001 XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.reficio.rcp</groupId>
    <artifactId>example-p2-site</artifactId>
    <packaging>pom</packaging>
    <version>1.5.1-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.reficio</groupId>
                <artifactId>p2-maven-plugin</artifactId>
                <version>1.3.0</version>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <id>org.hibernate:hibernate-entitymanager:5.4.28.Final</id>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

我已使用 mvn clean p2:site

然后在我的 target-platform.target 中引用了它:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target includeMode="feature" name="Running Platform">
    <locations>
        <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
            <repository location="file:/path/to/p2/target/repository/"/>
            <unit id="antlr" version="2.7.7"/>
            <unit id="com.fasterxml.classmate" version="1.5.1"/>
            <unit id="com.sun.istack.commons-runtime" version="3.0.7"/>
            <unit id="com.sun.xml.fastinfoset.FastInfoset" version="1.2.15"/>
            <unit id="javassist" version="3.27.0.GA"/>
            <unit id="javax.activation-api" version="1.2.0"/>
            <unit id="javax.persistence-api" version="2.2.0"/>
            <unit id="jaxb-api" version="2.3.1"/>
            <unit id="net.bytebuddy.byte-buddy" version="1.10.17"/>
            <unit id="org.dom4j" version="2.1.3"/>
            <unit id="org.glassfish.jaxb.runtime" version="2.3.1"/>
            <unit id="org.glassfish.jaxb.txw2" version="2.3.1"/>
            <unit id="org.hibernate.common.hibernate-commons-annotations" version="5.1.2.Final"/>
            <unit id="org.hibernate.entitymanager" version="5.4.28.Final"/>
            <unit id="org.hibernate.orm.core" version="5.4.28.Final"/>
            <unit id="org.jboss.jandex" version="2.2.3.Final"/>
            <unit id="org.jboss.logging.jboss-logging" version="3.4.1.Final"/>
            <unit id="org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec" version="1.1.1.Final"/>
            <unit id="org.jvnet.staxex.stax-ex" version="1.8.0"/>
        </location>
    </locations>
</target>

但是当我解决这个问题时,我收到此错误:

Problems occurred while resolving the target contents
    Cannot complete the install because one or more required items could not be found.
        Cannot satisfy dependency:
            From: hibernate-core 5.4.28.Final (org.hibernate.orm.core 5.4.28.Final)
            To: java.package; javax.transaction [1.1.0,2.0.0)
        Missing requirement: Java Transaction API 1.1.1.Final (org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec 1.1.1.Final) requires 'java.package; javax.interceptor [1.2.0,2.0.0)' but it could not be found
        Software being installed: hibernate-core 5.4.28.Final (org.hibernate.orm.core 5.4.28.Final)

请问我缺少什么?

I have a large Eclipse RCP application with lots of transitive dependencies.

Currently, these are manually copied into the classpath but that's a significant administrative overhead I'd like to avoid, and would instead like to use p2-maven-plugin.

I've created a simple pom.xml based on the supplied example, that imports a Hibernate dependency:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001 XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.reficio.rcp</groupId>
    <artifactId>example-p2-site</artifactId>
    <packaging>pom</packaging>
    <version>1.5.1-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.reficio</groupId>
                <artifactId>p2-maven-plugin</artifactId>
                <version>1.3.0</version>
                <executions>
                    <execution>
                        <id>default-cli</id>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <id>org.hibernate:hibernate-entitymanager:5.4.28.Final</id>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

I've compiled this to a local p2 repository using mvn clean p2:site.

And in my target-platform.target I've then referenced it:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target includeMode="feature" name="Running Platform">
    <locations>
        <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
            <repository location="file:/path/to/p2/target/repository/"/>
            <unit id="antlr" version="2.7.7"/>
            <unit id="com.fasterxml.classmate" version="1.5.1"/>
            <unit id="com.sun.istack.commons-runtime" version="3.0.7"/>
            <unit id="com.sun.xml.fastinfoset.FastInfoset" version="1.2.15"/>
            <unit id="javassist" version="3.27.0.GA"/>
            <unit id="javax.activation-api" version="1.2.0"/>
            <unit id="javax.persistence-api" version="2.2.0"/>
            <unit id="jaxb-api" version="2.3.1"/>
            <unit id="net.bytebuddy.byte-buddy" version="1.10.17"/>
            <unit id="org.dom4j" version="2.1.3"/>
            <unit id="org.glassfish.jaxb.runtime" version="2.3.1"/>
            <unit id="org.glassfish.jaxb.txw2" version="2.3.1"/>
            <unit id="org.hibernate.common.hibernate-commons-annotations" version="5.1.2.Final"/>
            <unit id="org.hibernate.entitymanager" version="5.4.28.Final"/>
            <unit id="org.hibernate.orm.core" version="5.4.28.Final"/>
            <unit id="org.jboss.jandex" version="2.2.3.Final"/>
            <unit id="org.jboss.logging.jboss-logging" version="3.4.1.Final"/>
            <unit id="org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec" version="1.1.1.Final"/>
            <unit id="org.jvnet.staxex.stax-ex" version="1.8.0"/>
        </location>
    </locations>
</target>

But when I resolve this, I get this error:

Problems occurred while resolving the target contents
    Cannot complete the install because one or more required items could not be found.
        Cannot satisfy dependency:
            From: hibernate-core 5.4.28.Final (org.hibernate.orm.core 5.4.28.Final)
            To: java.package; javax.transaction [1.1.0,2.0.0)
        Missing requirement: Java Transaction API 1.1.1.Final (org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec 1.1.1.Final) requires 'java.package; javax.interceptor [1.2.0,2.0.0)' but it could not be found
        Software being installed: hibernate-core 5.4.28.Final (org.hibernate.orm.core 5.4.28.Final)

What am I missing, please?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文