4 Replies Latest reply on Feb 11, 2015 4:48 PM by maol

    Arquillian maven resolver for ejb problem

    maol Newbie

      Hi everyone,

       

      I have created project according to Java EE 6 spec. using Maven approach:   rest module -> ejb module -> repository module -> MySQL

       

      All modules are packed in one .ear. For Rest-module, the ejb module dependencies is defined by this:

      <dependency>

          <groupId>com.private</groupId>

          <artifactId>stat-logic</artifactId>

          <type>ejb</type>

          <scope>provided</scope>

      </dependency>

       

      Now, I am writing IT for Rest-module using Arquillian framework (arquillian-bom version is set to "1.1.4.Final") and I am trying to load ejb module using maven resolver:

       

      PomEquippedResolveStage pomResolver = Maven.configureResolver().workOffline().loadPomFromFile("pom.xml");

      File ejbModule = pomResolver.resolve(com.private:stat-logic).withoutTransitivity().asSingleFile();

       

      During execution this code I am receiving execption:

      org.jboss.shrinkwrap.resolver.api.ResolutionException: Unable to get version for dependency specified by com.private:stat-logic:compile:, it was either null or empty.

       

       

      Interesting: For arquillian-bom version set to "1.1.3.Final", the code below works correctly:

       

      PomEquippedResolveStage pomResolver = Maven.resolver().offline().loadPomFromFile("pom.xml");

      File ejbModule = pomResolver.resolve(com.private:stat-logic).withoutTransitivity().asSingleFile();

       

      Any suggestion how to solve it?

        • 1. Re: Arquillian maven resolver for ejb problem
          Aslak Knutsen Master

          Maybe try "com.private:stat-logic:ejb:?:"

           

          The ? means attempt to resolve the version, in this case from the pom.

          • 2. Re: Re: Arquillian maven resolver for ejb problem
            maol Newbie

            For: "com.private:stat-logic:ejb:?:" I get: org.jboss.shrinkwrap.resolver.api.CoordinateParseException: Bad artifact coordinates, expected format is <groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?'), got: com.private:stat-logic:ejb:?:

             

            For: "com.private:stat-logic:ejb:?" I get: org.jboss.shrinkwrap.resolver.api.ResolutionException: Unable to get version for dependency specified by com.private:stat-logic:ejb:?:compile, it was not provided in neither <dependencyManagement> nor <dependencies> sections.

             

            For: "com.private:stat-logic:ejb:provided:?" I get: org.jboss.shrinkwrap.resolver.api.ResolutionException: Unable to get version for dependency specified by com.private:stat-logic:ejb:provided:?:compile, it was not provided in neither <dependencyManagement> nor <dependencies> sections.

            • 3. Re: Arquillian maven resolver for ejb problem
              Aslak Knutsen Master

              Where is the version for this dependency defined?

              • 4. Re: Re: Arquillian maven resolver for ejb problem
                maol Newbie

                This is parent 'pom.xml':

                <project>

                    <groupId>com.private</groupId>

                    <artifactId>stat-root</artifactId>

                    <version>1.0.1-SNAPSHOT</version>

                    <packaging>pom</packaging>

                   

                    <dependencyManagement>

                        <dependency>

                            <groupId>com.private</groupId>

                            <artifactId>stat-logic</artifactId>

                            <version>1.0.1-SNAPSHOT</version>

                            <type>ejb</type>

                        </dependency>

                        :

                    </dependencyManagement>

                    :

                </project>

                 

                This is pom.xml for Rest-module:

                <project>

                    <parent>

                        <groupId>com.private</groupId>

                        <artifactId>stat-root</artifactId>

                        <version>1.0.1-SNAPSHOT</version>

                    </parent>

                   

                    <dependencies>

                        <dependency>

                            <groupId>com.private</groupId>

                            <artifactId>stat-logic</artifactId>

                            <type>ejb</type>

                            <scope>provided</scope>

                        </dependency>

                        :

                    </dependencies>

                    :

                </project>