1 year ago

#288282

test-img

Jakg

p2-maven-plugin - "missing requirement" "requires 'java.package; javax.interceptor [1.2.0,2.0.0)' but it could not be found"

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?

java

maven

osgi

eclipse-rcp

p2

0 Answers

Your Answer

Accepted video resources