2 Replies Latest reply on Feb 5, 2010 7:45 AM by dan.j.allen

    problems with Weld archetype or Maven repo?

    asookazian

      I'm following these instructions:


      http://seamframework.org/Documentation/WeldQuickstartForMavenUsers


      I have the Maven project generated by m2eclipse plugin in Eclipse workspace for weld-jsf-jee.


      I am getting this:


      C:\Documents and Settings\asookazian\workspace\weld-archetype\full>mvn package j
      boss:hard-deploy
      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Required goal not found: jboss:hard-deploy in org.codehaus.mojo:jboss-mav
      en-plugin:1.3.1
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: < 1 second
      [INFO] Finished at: Fri Jan 29 14:24:48 PST 2010
      [INFO] Final Memory: 4M/7M
      [INFO] ------------------------------------------------------------------------



      I have archetype-catalog.xml here: C:\Documents and Settings\asookazian\.m2


      and this in C:\java\apache-maven-2.2.1\conf\settings.xml:


      <profiles>
             <profile>
                 <id>environment</id>
                 <activation>
                    <activeByDefault>true</activeByDefault>
                 </activation>
                 <properties>
                    <jboss.home>/java/jboss-6.0.0.M1</jboss.home>
                 </properties>
            </profile>
      </profiles>



      Here is the full pom.xml for my project:


      <?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.example</groupId>
         <artifactId>full</artifactId>
         <packaging>war</packaging>
         <name>full</name>
         <version>1.0.0-SNAPSHOT</version>
      
         <properties>
            <!--
               Explicitly declaring the source encoding eliminates the following message:
               [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
            -->
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <!--
               To set the jboss.home environment variable the Maven way, set the jboss.home property in an active profile in
               the Maven 2 settings.xml file
            -->
            <jboss.home>${env.JBOSS_HOME}</jboss.home>
            <jboss.domain>default</jboss.domain>
            <!-- The version of Weld extensions in use -->
            <weld.extensions.version>1.0.0-CR2</weld.extensions.version>
         </properties>
      
         <repositories>
             <!-- Several key Java EE APIs and RIs are missing from the Maven Central Repository -->
             <!-- The goal is to eventually eliminate the reliance on the JBoss repository -->
             <repository>
                <id>repository.jboss.org</id>
                <name>JBoss Repository</name>
                <url>http://repository.jboss.org/maven2</url>
             </repository>
         </repositories>
      
         <dependencyManagement>
            <dependencies>
               <!-- Import scope will provide versions for dependencies below. -->
               <dependency>
                  <groupId>org.jboss.weld</groupId>
                  <artifactId>weld-extensions-bom</artifactId>
                  <version>${weld.extensions.version}</version>
                  <type>pom</type>
                  <scope>import</scope>
               </dependency>
            </dependencies>
         </dependencyManagement>
         <dependencies>
            <!-- CDI (JSR-299) -->
            <dependency>
               <groupId>javax.enterprise</groupId>
               <artifactId>cdi-api</artifactId>
               <scope>provided</scope>
            </dependency>
            <!-- EJB -->
            <dependency>
               <groupId>org.jboss.ejb3</groupId>
               <artifactId>jboss-ejb3-api</artifactId>
               <scope>provided</scope>
               <version>3.1.0</version>
            </dependency>
            <!-- Common annotations (e.g., @PostConstruct, @PreDestroy, @Generated, @Resource) -->
            <dependency>
               <groupId>javax.annotation</groupId>
               <artifactId>jsr250-api</artifactId>
               <scope>provided</scope>
            </dependency>
            <!-- Bean Validation (JSR-303) -->
            <dependency>
               <groupId>javax.validation</groupId>
               <artifactId>validation-api</artifactId>
               <scope>provided</scope>
            </dependency>
            <!-- Bean Validation Implementation -->
            <!-- Provides portable constraints such as @NotEmpty, @Email and @Url -->
            <!-- Hibernate Validator is only the JSR-303 implementation at the moment, so we can assume it's provided -->
            <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>hibernate-validator</artifactId>
               <version>4.0.0.GA</version>
               <scope>provided</scope>
            </dependency>
            <!-- JSF -->
            <dependency>
               <groupId>javax.faces</groupId>
               <artifactId>jsf-api</artifactId>
               <scope>provided</scope>
            </dependency>
            <!-- JPA -->
            <dependency>
               <groupId>javax.persistence</groupId>
               <artifactId>persistence-api</artifactId>
               <scope>provided</scope>
            </dependency>
      
            <!-- Optional, but highly recommended. -->
            <dependency>
               <groupId>org.testng</groupId>
               <artifactId>testng</artifactId>
               <version>5.10</version>
               <scope>test</scope>
               <classifier>jdk15</classifier>
            </dependency>
      
            <!-- Needed on JBoss AS as EL is out of date -->
            <dependency>
               <groupId>org.glassfish.web</groupId>
               <artifactId>el-impl</artifactId>
               <scope>runtime</scope>
               <!-- FIXME this version should be in the Weld API BOM -->
               <version>2.1.2-b04</version>
               <exclusions>
                  <exclusion>
                     <groupId>javax.el</groupId>
                     <artifactId>el-api</artifactId>
                  </exclusion>
               </exclusions>
            </dependency>
         </dependencies>
         <build>
            <finalName>${artifactId}</finalName>
            <plugins>
               <!-- Compiler plugin enforces Java 1.6 compatiblity -->
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <configuration>
                     <source>1.6</source>
                     <target>1.6</target>
                  </configuration>
               </plugin>
      
               <!-- Eclipse plugin can force download of source and JavaDoc jars -->
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-eclipse-plugin</artifactId>
                  <configuration>
                     <wtpversion>2.0</wtpversion>
                     <!--
                     <downloadSources>true</downloadSources>
                     <downloadJavadocs>true</downloadJavadocs>
                     -->
                  </configuration>
               </plugin>
      
               <!-- Configure the JBoss AS Maven deploy plugin -->
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>jboss-maven-plugin</artifactId>
                  <configuration>
                     <jbossHome>${jboss.home}</jbossHome>
                     <serverName>${jboss.domain}</serverName>
                     <fileNames>
                        <fileName>${project.build.directory}/${build.finalName}.war</fileName>
                     </fileNames> 
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </project>
      



      JBOSS_HOME = C:\java\jboss-6.0.0.M1


      What am I missing?

        • 1. Re: problems with Weld archetype or Maven repo?
          asookazian

          I'm using JDK6 and this:


          http://mojo.codehaus.org/jboss-maven-plugin/plugin-info.html


          Note that <version/> is included below:


          <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>jboss-maven-plugin</artifactId>
                  <version>1.4</version>
                </plugin>
          



          This line was missing in my pom.xml after the mvn archetype:generate via m2eclipse plugin in Eclipse:


          <version>1.4</version>


          Is this a known issue?  I'm wondering what version Maven uses if you don't specify a version?


          Now here is my status:


          C:\Documents and Settings\asookazian\workspace\weld-archetype\full>mvn jboss:har
          d-deploy
          [INFO] Scanning for projects...
          [INFO] ------------------------------------------------------------------------
          [INFO] Building full
          [INFO]    task-segment: [jboss:hard-deploy]
          [INFO] ------------------------------------------------------------------------
          Downloading: http://repo1.maven.org/maven2/jboss/jboss-jmx/4.0.2/jboss-jmx-4.0.2
          .pom
          
          Downloading: http://repo1.maven.org/maven2/jboss/jnp-client/4.0.2/jnp-client-4.0
          .2.pom
          
          Downloading: http://repo1.maven.org/maven2/jboss/jboss-common/4.0.2/jboss-common
          -4.0.2.pom
          
          Downloading: http://repository.jboss.org/maven2/slide/webdavlib/2.0/webdavlib-2.
          0.pom
          [INFO] Unable to find resource 'slide:webdavlib:pom:2.0' in repository repositor
          y.jboss.org (http://repository.jboss.org/maven2)
          Downloading: http://repo1.maven.org/maven2/slide/webdavlib/2.0/webdavlib-2.0.pom
          
          
          Downloading: http://repository.jboss.org/maven2/xerces/xercesImpl/2.6.2/xercesIm
          pl-2.6.2.pom
          150b downloaded  (xercesImpl-2.6.2.pom)
          Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.5.
          9/plexus-utils-1.5.9.pom
          
          Downloading: http://repository.jboss.org/maven2/xerces/xercesImpl/2.6.2/xercesIm
          pl-2.6.2.jar
          Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.5.
          9/plexus-utils-1.5.9.jar
          Downloading: http://repository.jboss.org/maven2/slide/webdavlib/2.0/webdavlib-2.
          0.jar
          Downloading: http://repo1.maven.org/maven2/jboss/jboss-jmx/4.0.2/jboss-jmx-4.0.2
          .jar
          [INFO] Unable to find resource 'slide:webdavlib:jar:2.0' in repository repositor
          y.jboss.org (http://repository.jboss.org/maven2)
          Downloading: http://repo1.maven.org/maven2/slide/webdavlib/2.0/webdavlib-2.0.jar
          
          986K downloaded  (xercesImpl-2.6.2.jar)
          
          
          
          Downloading: http://repo1.maven.org/maven2/jboss/jnp-client/4.0.2/jnp-client-4.0
          .2.jar
          
          Downloading: http://repo1.maven.org/maven2/jboss/jboss-common/4.0.2/jboss-common
          -4.0.2.jar
          
          [INFO] [jboss:hard-deploy {execution: default-cli}]
          [INFO] Copying C:\Documents and Settings\asookazian\workspace\weld-archetype\ful
          l\target\full.war to C:\java\jboss-6.0.0.M1\server\default\deploy\full.war
          [INFO] ------------------------------------------------------------------------
          [ERROR] BUILD ERROR
          [INFO] ------------------------------------------------------------------------
          [INFO] Mojo error occurred: C:\Documents and Settings\asookazian\workspace\weld-
          archetype\full\target\full.war (The system cannot find the file specified)
          
          [INFO] ------------------------------------------------------------------------
          [INFO] For more information, run Maven with the -e switch
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 14 seconds
          [INFO] Finished at: Fri Jan 29 15:15:02 PST 2010
          [INFO] Final Memory: 5M/10M
          [INFO] ------------------------------------------------------------------------

          • 2. Re: problems with Weld archetype or Maven repo?
            dan.j.allen

            The version of the jboss-maven-plugin is supposed to be defined in Weld parent (or another pom in the inheritance hierarchy), but it is not. I'll file a JIRA.


            https://jira.jboss.org/jira/browse/WELD-418