5 Replies Latest reply on May 25, 2011 1:51 PM by matteg.gerry.matte.shaw.ca

    Seam 3 examples

    asookazian

      So I finally downloaded and extracted Maven 3, JBoss 6.0-final and Seam 3.0-CR1.  Good job guys!


      Whatever happened to the build.xml ant script (from Weld) with the macrodef tag that allows ant to hook into maven?  When I ran

      mvn clean install

      for the helloworld example app, the WAR file was not automatically copied to the JBoss /server/default/deploy directory as I expected (yes, I'm lazy).  either that or use maven's antrun plugin to use the ant copy task:


      My Link


      the idmconsole build failed:


      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 46.535s
      [INFO] Finished at: Thu Mar 03 22:53:08 PST 2011
      [INFO] Final Memory: 5M/10M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal on project seam-security-idmconsole-example: Coul
      d not resolve dependencies for project org.jboss.seam.security:seam-security-idm
      console-example:war:3.0.0.CR1: Failed to collect dependencies for [org.jboss.sea
      m.security:seam-security-impl:jar:3.0.0.CR1 (compile), org.drools:drools-core:ja
      r:5.1.1 (compile), org.drools:drools-compiler:jar:5.1.1 (compile), org.jboss.sea
      m.persistence:seam-persistence:jar:3.0.0.Beta2 (compile), org.jboss.seam.config:
      seam-config-xml:jar:3.0.0.Beta2 (runtime), javax.enterprise:cdi-api:jar:1.0-SP4
      (provided), org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Fina
      l (provided), javax.validation:validation-api:jar:1.0.0.GA (provided), org.hiber
      nate:hibernate-validator:jar:4.0.0.GA (provided), javax.faces:jsf-api:jar:2.0 (p
      rovided), org.testng:testng:jar:jdk15:5.10 (test), org.glassfish.web:el-impl:jar
      :2.1.2-b04 (runtime)]: Failed to read artifact descriptor for javax.faces:jsf-ap
      i:jar:2.0: Could not transfer artifact javax.faces:jsf-api:pom:2.0 from/to jboss
      -public-repository-group (https://repository.jboss.org/nexus/content/groups/publ
      ic/): Error transferring file: repository.jboss.org: Unknown host repository.jbo
      ss.org -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
      ch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please rea
      d the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
      lutionException
      C:\java\seam-3.0.0.CR1\examples\idmconsole>



      here is my settings.xml in .m2 directory:


      <settings>
        
         <profiles>
           
            <profile>
              <id>jboss-public-repository</id>
              <repositories>
                <repository>
                  <id>jboss-public-repository-group</id>
                  <name>JBoss Public Maven Repository Group</name>
                  <url>https://repository.jboss.org/nexus/content/groups/public/</url>
                  <layout>default</layout>
                  <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                  </releases>
                  <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                  </snapshots>
                </repository>
              </repositories>
              <pluginRepositories>
                <pluginRepository>
                  <id>jboss-public-repository-group</id>
                  <name>JBoss Public Maven Repository Group</name>
                  <url>https://repository.jboss.org/nexus/content/groups/public/</url>
                  <layout>default</layout>
                  <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                  </releases>
                  <snapshots>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                  </snapshots>
                </pluginRepository>
              </pluginRepositories>
            </profile>
        
          </profiles>
        
          <activeProfiles>
            <activeProfile>jboss-public-repository</activeProfile>
          </activeProfiles>
        
      </settings>
      

        • 1. Re: Seam 3 examples
          shane.bryzak

          It seems you have a problem with your internet connection or DNS? (based on this snippet from your log):



          Error transferring file: repository.jboss.org: Unknown host repository.jboss.org




          Also, to deploy to JBoss AS you can use the jboss:hard-deploy goal in Maven - I think you just have to set up the JBOSS_HOME environment variable for this to work.

          • 2. Re: Seam 3 examples
            asookazian

            Thanks Shane.  The internet connection was indeed spotty last nite, so perhaps that's the root cause there.


            I have heard of the jboss:hard-deploy goal, but that will simply copy the WAR/EAR.  For exploded deployments (which is what is/was recommended with Seam 2 and assuming with Seam 3 during development), I don't think Maven has anything helpful.


            I'm using a custom ant script (build.xml) for my current project that hooks into maven via <macrodef> tag.  Here is that particular target for unzipping:


            <target name="unzip">
                      <echo message="**************Beginning unzip target..."/>
                      <echo message="Base directory is ${basedir}" />     
                      <mkdir dir="${basedir}\target\${ear.app.name}\temp"/>
                      <unzip src="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\${war.app.name}.war" dest="${basedir}\target\${ear.app.name}\temp"/>
                      <delete file="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\${war.app.name}.war"/>
                      <mkdir dir="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\${war.app.name}.war"/>
                      <copy todir="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\${war.app.name}.war">
                           <fileset dir="${basedir}\target\${ear.app.name}\temp" />
                      </copy>
                      <delete dir="${basedir}\target\${ear.app.name}\temp"/>
                 </target>



            and the explode target:


            <target name="explode" depends="showproperties, clean, install, unzip" description="Runs mvn clean install and then unzips the EAR/WAR and copies to JBoss deploy directory">
                      <echo message="**************Beginning explode target..."/>
                      <echo message="**************maven.profile = ${maven.profile}"/>
                      
                      <mkdir dir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear" />
                      <copy todir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear">
                           <fileset dir="${artifact.dir}" />
                      </copy>
                      <tstamp>  
                          <format property="now" pattern="MM/dd/yyyy hh:mm:ss" locale="en,US"/>  
                      </tstamp>  
                      <echo message="Current datetime: ${now}"/>
                      <echo message="The app can be accessed at ${final.url}" />
                 </target>



            I'm wondering if Maven 3 has functionality that will accommodate this type of deployment...

            • 3. Re: Seam 3 examples

              I am having the same question as Arbi. Has anybody a solution or answer to his question? For the moment (with seam2, maven structure) we are also  using a specific ant task to do our exploding of our EAR.
              It would be nice to add this kind of functionality (hot deployment) to the seam 3 examples.

              • 4. Re: Seam 3 examples
                matteg.gerry.matte.shaw.ca

                There seems to be a POM.xml problem with a number of the seam 3 examples distributed with 3.0.0.Final.
                The dependency for JSF fails to specify a <version> tag and consequently the initial step of the maven downloads fails.  Because of that failure, succeeding steps fail and generated a very imposing list of failures.


                If you insert a valid version tag after line 89 of the pom.xml for security-idmconsole the maven commands will now execute.




                      <!-- JSF -->
                      <dependency>
                         <groupId>javax.faces</groupId>
                         <artifactId>jsf-api</artifactId>
                         <!-- Added by GM 22May11 -->
                         <version>2.0.2-FCS</version>
                         <scope>provided</scope>
                      </dependency>
                



                • 5. Re: Seam 3 examples
                  matteg.gerry.matte.shaw.ca

                  I should also add that my solution may be a work around for a dependancy lookup that should be working without the version tag.


                  I am only just learning maven as a result of test drives of seam 3.


                  If there is a better solution than my workaround I encourage others to speak up.