Maven Build Failure For JBoss AS 7 Hello world example

后端 未结 4 1111
悲&欢浪女
悲&欢浪女 2021-01-12 16:57

Im trying to follow this tutorial: https://docs.jboss.org/author/display/AS7/Helloworld+quickstart

But getting build error when following the simple instructions to

相关标签:
4条回答
  • 2021-01-12 17:42

    Removing of redHat "postfix" resolved the problem, just have actual jar name, instead of having redHat postfix.

    Have below dependencies in your pom.xml, then it will build successfully.

         <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.spec</groupId>
                    <artifactId>jboss-javaee-6.0</artifactId>
                    <version>3.0.2.Final</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <dependencies>
            <dependency>
                <groupId>javax.enterprise</groupId>
                <artifactId>cdi-api</artifactId>
                <version>1.0-SP4</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.annotation</groupId>
                <artifactId>jboss-annotations-api_1.1_spec</artifactId>
                <version>1.0.1.Final</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.servlet</groupId>
                <artifactId>jboss-servlet-api_3.0_spec</artifactId>
                <version>1.0.2.Final</version>
                <scope>provided</scope>
            </dependency>
          </dependencies>
    
    0 讨论(0)
  • 2021-01-12 17:48

    If you clone the quickstarts from the github repository, e.g.

    git clone --recursive git://github.com/jboss-jdf/jboss-as-quickstart.git --branch jdf-2.1.9.Final
    

    See: http://www.jboss.org/jdf/quickstarts/get-started/

    then you will find a maven settings.xml file in the root directory (./jboss-as-quickstart/settings.xml)

    For each example, run maven with that settings file:

    cd jboss-as-quickstart
    cd helloworld
    mvn -s ..\settings.xml compile
    

    See: http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/#configure-maven

    0 讨论(0)
  • 2021-01-12 17:49

    OK, here's what fixed it:

    Commented out this line in the pom.xml: (I thought this is a type of variable that gets automatically inserted/replaced by eclipse/something, turns out NO IT IS NOT):

    <!--                 <version>${version.org.jboss.spec.jboss.javaee.6.0}</version> -->
    

    Replace with:

    <version>3.0.2.Final</version>
    

    It now builds and I can deploy it fine, thanks for the help Nishant!

    0 讨论(0)
  • 2021-01-12 17:50

    You might have to create one (see this page for more details):

    There are two locations where a settings.xml file may live:

    • The Maven install: $M2_HOME/conf/settings.xml
    • A user's install: ${user.home}/.m2/settings.xml

    But I feel the issue is with the version string of the dependency. Hardcode the version and try again:

    <dependency>
        <groupId>org.jboss.spec</groupId>
        <artifactId>jboss-javaee-6.0</artifactId>
        <version>3.0.2.Final</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
    

    Uncommenting the following line might work too:

    <version.org.jboss.spec.jboss.javaee.6.0>3.0.2.Final
        </version.org.jboss.spec.jboss.javaee.6.0>
    
    0 讨论(0)
提交回复
热议问题