3 Replies Latest reply on Jun 3, 2010 11:38 AM by asookazian

    seamgen in Seam 3

    asookazian

      is there a prototype or similar available for Seam 3 seamgen with maven?  I'm interested as my current project is using Maven 2.x with m2e plugin in Eclipse.

        • 1. Re: seamgen in Seam 3
          asookazian

          also, what about support for parent POMs and grandparent POMs for setting up a hierarchical structure like we have on our current project.


          we actually have two Seam 2.x projects that use the same common POM for a lot of libraries like RichFaces, Apache Commons, etc. that are popular and shared.


          Maven Super POM --> Common POM --> Parent POM --> module POM


          Also will it include the maven-cli-plugin (which is now a JBoss product???) as well as integration with m2e which is not supporting WTP unfortunately and seems to be buggy with 0.9.8 and 0.10.0.


          One thing I hate about m2e is the auto builds it does for all the Maven module POMs in our project (10 or so per parent POM) and you have to disable that per POM.  Really slows down your Eclipse dev experience...


          But JBT lead Max Andersen has recommended using m2e and not using mvn eclipse:eclipse.


          I haven't heard too much about what is going on right now with seamgen and Maven stuff....

          • 2. Re: seamgen in Seam 3
            cjalmeida

            There are some maven archetypes for Weld/CDI (Seam 3 are just modules on top of CDI) here http://seamframework.org/Documentation/WeldQuickstartForMavenUsers


            I used their skeletons to learn about the dependencies to build my own multi-project pom.xml. I just used the standard maven ear, war, ejb plugins for packaging.


            However, I still find maven a PITA for anything but the most basic lifecycles. Creating an exploded ear requires you to write a plugin! That's why I'm learning to use something saner, like Gradle.


            • 3. Re: seamgen in Seam 3
              asookazian
              <project basedir="." name="cis.build.script" default="copyfacelets">
                   
                   
                   
                   <!-- ********************************* BUILD TARGETS ************************************ -->
                   
                   <target name="unzip">
                        <echo message="Base directory is ${basedir}" />     
                        <mkdir dir="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\temp"/>
                        <unzip src="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\${war.app.name}.war" dest="${basedir}\com.echo.cis.gui.ear\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}\com.echo.cis.gui.ear\target\${ear.app.name}\temp" />
                        </copy>
                        <delete dir="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\temp"/>
                   </target>
                   
                   <target name="package">
                        <maven target="install" basedir="${basedir}">
                             <arg line="-f ${pom.file} -o -npu -Dmaven.test.skip=true" />
                        </maven>
                   </target>
              
                   <target name="clean">
                        <echo message="Deleting ${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\temp directory"/>
                        <delete dir="${basedir}\com.echo.cis.gui.ear\target\${ear.app.name}\temp"/>
                        <maven target="clean" basedir="${basedir}">
                         <arg line="-f ${pom.file}" />
                        </maven>
                   </target>
              
                   <target name="tomcat.package">
                        <maven target="install" basedir="${basedir}">
                         <arg line="-f ${pom.file} -Ptomcat" />
                        </maven>
                   </target>
              
                   <target name="explode" depends="clean, package, unzip">
                        <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>
                   
                   <target name="copyfacelets">
                        <copy todir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear/${war.app.name}.war/restricted/billing">
                             <fileset refid="war.billing.view" />               
                        </copy>
                        <copy todir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear/${war.app.name}.war/restricted/merchant">
                             <fileset refid="war.merchant.view" />               
                        </copy>
                        <copy todir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear/${war.app.name}.war/restricted/assessment">
                             <fileset refid="war.assessment.view" />               
                        </copy>
                        <copy todir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear/${war.app.name}.war/resources/js">
                             <fileset refid="war.js" />               
                        </copy>
                        <echo message="The app can be accessed at ${final.url}" />
                   </target>
              
                   
                   <target name="unexplode" description="Undeploy the exploded archive">
                        <delete failonerror="no">
                             <fileset dir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear">
                                  <exclude name="**/*.jar" />
                             </fileset>
                        </delete>               
                        <delete dir="${jboss.home}/server/${jboss.profile}/deploy/${ear.app.name}.ear" failonerror="no" />          
                   </target>
                   
                   <target name="eclipse:clean">
                        <maven target="eclipse:clean" basedir="${basedir}">
                             <arg line="-f ${pom.file}" />
                        </maven>
                   </target>
                   
                   <target name="eclipse:eclipse">
                        <maven target="eclipse:eclipse" basedir="${basedir}">
                             <arg line="-f ${pom.file}" />
                        </maven>
                   </target>
                   
                   <!-- ************************************ MAVEN MACRODEF CONFIG ********************************************** -->
              
              
                   <macrodef name="maven">
                        <attribute name="target" />
                        <attribute name="basedir" />
                        <element name="args" implicit="true" optional="true" />
                        <sequential>
                             <java classname="org.codehaus.classworlds.Launcher" fork="true" dir="@{basedir}" failonerror="true">
                                  <classpath>
                                       <fileset dir="${maven.dir}/boot">
                                            <include name="*.jar" />
                                       </fileset>
                                       <fileset dir="${maven.dir}/bin">
                                            <include name="*.*" />
                                       </fileset>
                                  </classpath>
                                  <sysproperty key="classworlds.conf" value="${maven.dir}/bin/m2.conf" />
                                  <sysproperty key="maven.home" value="${maven.dir}" />
                                  <args />
                                  <arg line="@{target}" />
                             </java>
                        </sequential>
                   </macrodef>
              
              </project>