14 Replies Latest reply on Sep 6, 2007 5:10 PM by Anders Andersen

    Maven Archetype for Seam?

    David Geary Newbie

      Is there a Maven archetype for Seam? Seam is great, but I've spent way too much time configuring a simple app to run embedded in Tomcat. If I could create a starter app with a maven archetype, I'd have a lot more time to actually write code.

      A Maven archetype for Seam would further close the productivity gap between Rails and JEE.

        • 1. Re: Maven Archetype for Seam?
          Gavin King Master

          Unfortunately I don't know anything about Maven, so we would need some nice volunteer to contribute this :-)

          • 2. Re: Maven Archetype for Seam?
            Bradley Smith Master

            I managed to successfully create a Maven 2 archetype for a Seam App.

            My app style was EJB3 entities, Hibernate SessionFactory (as entity manager), Facelets, and pure POJO's for application actions. Thus, my layout would work for an app that is packaged as a .war and based on a similar approach. If there is interest, I can clean this up and share it a bit.

            Regards
            Brad Smith

            • 3. Re: Maven Archetype for Seam?
              Bradley Smith Master

              One other thing... my biggest pain points were the figuring out the initial configuration of the pieces to make my Seam app. After I had a working configuration and build, it was extremely easy to add in additional features to my app.

              Regards

              • 4. Re: Maven Archetype for Seam?
                David Geary Newbie

                My pain points also were (and continue to be) configuring the application. Archetypes, of course, would eliminate that frustration completely by giving us an analog to the 'rails' script. Amen.

                Personally, I'd like to see a minimal CRUD app with various archetypes for different configurations under both Tomcat and JBoss.

                btw, Gavin, creating a Maven archetype takes no more than 10 mins, even if you know nothing about Maven. See http://maven.apache.org/guides/mini/guide-creating-archetypes.html for details.

                • 5. Re: Maven Archetype for Seam?
                  Thomas Heute Master

                  If an archetype means writing the pom, then it is planned (unfortunately i won't have the time before next week). It will take me much more that 10 minutes to define all the dependencies (and creating the pom files for them) without forgetting any, trust me ;) But if you can do it in 10 min i will be happy to include it to our Maven repository.)

                  • 6. Re: Maven Archetype for Seam?
                    Charles (Chuck) Canning Newbie

                    This would be great. I am trying to learn seam/facelets/jsf and get it working with the embedded ejb container. It would be great to have the maven pom generated so that I don't have to figure out all of the package layouts and dependencies to get this running with my maven environment.

                    • 7. Re: Maven Archetype for Seam?
                      Thomas Heute Master

                      The problem i have about dependencies is that it depends on which environment you want it to run.
                      So far i added the pom files for jboss-seam.jar jboss-seam-ui.jar jboss-seam-debug.jar in our maven2 repository without dependencies.

                      • 8. Re: Maven Archetype for Seam?
                        David Geary Newbie

                        Writing a Maven archetype involves writing two POMs, in addition to the layout and files that you want the archetype to generate. (btw, my comment about 10 minutes meant that you can learn to create an archetype in 10 mins. Ce n'est pas le meme chose, Thomas. 8-))

                        I think we need several archetypes, one for each environment, for example:

                        JBoss/Hibernate
                        Tomcat/EJB
                        ...

                        I won't have any time to work on this until next week. I'd like to put together a simple archetype that we could use as a starting point.

                        • 9. Re: Maven Archetype for Seam?
                          Arthur Hupka Newbie

                          Any news on that?
                          I'm really struggling around getting an EJB3/War Web Application Environment to work...
                          Im familiar with Plain Hibernate / Seam / Microcontainer with Entity Beans, and now im interested in EJB3 and would really like to have any tutorial (or archetype) to getting started... (Im trying now for 2 days to get sth. to work)

                          I can't find sth. on google on that topic ( Building Web Apps with Seam, Maven, EJB3, Jboss AS) and im really confused on how to package my app in an ear and so on...

                          Could anybody do some pioneer work on that who is more familiar with j2ee, maven, seam and write a how to guide? It would be amazing!
                          Im really frustrated on that, and thought to throw that topic in the corner, until it is possible to build seam with maven...

                          • 10. Re: Maven Archetype for Seam?
                            Jarek Odzga Newbie

                            Hi,
                            Any update on that?
                            i am also interested in using seam with maven...

                            • 11. Re: Maven Archetype for Seam?
                              Anders Andersen Newbie

                              I have been trying to make the dvdstore sample as a maven project.
                              The project will have 3 subartifacts
                              1. ejb - containing all classes
                              2. war - containing the web
                              3. ear - packaging the stuff
                              And it is very simple to make the artifacts, but I cannot currently get all dependencies right.

                              I setup a repository with http://maven.softeu.cz/

                              I then the ejb by dependencies

                              <dependencies>
                               <dependency>
                               <groupId>jboss.seam</groupId>
                               <artifactId>jboss-seam</artifactId>
                               <version>2.0.0.BETA1</version>
                               </dependency>
                               <dependency>
                               <groupId>javax.ejb</groupId>
                               <artifactId>ejb</artifactId>
                               <version>3.0-RC8</version>
                               </dependency>
                               <dependency>
                               <groupId>javax.faces</groupId>
                               <artifactId>jsf-api</artifactId>
                               <version>1.2</version>
                               </dependency>
                               <dependency>
                               <groupId>org.apache.lucene</groupId>
                               <artifactId>lucene-core</artifactId>
                               <version>2.1.0</version>
                               </dependency>
                               <dependency>
                               <groupId>jboss</groupId>
                               <artifactId>jbpm</artifactId>
                               <version>3.1.4</version>
                               </dependency>
                               <dependency>
                               <groupId>org.testng</groupId>
                               <artifactId>testng</artifactId>
                               <version>5.5</version>
                               <classifier>jdk15</classifier>
                               </dependency>
                               </dependencies>
                              


                              But currently I am missing
                              /dvdstore/ejb/src/main/java/com/jboss/dvd/seam/Product.java:[29,40] cannot find symbol
                              symbol : class IndexedEmbedded
                              location: package org.hibernate.search.annotations
                              


                              It is an artifact by name hibernate-search.jar ?? I cannot find it at the moment.

                              • 12. Re: Maven Archetype for Seam?
                                Vincent Latombe Newbie

                                Use this :


                                org.hibernate
                                hibernate-annotations
                                3.2.1.ga
                                </dependency

                                • 13. Re: Maven Archetype for Seam?
                                  Vincent Latombe Newbie

                                  Sorry.... formatting

                                  <dependency>
                                   <groupId>org.hibernate</groupId>
                                   <artifactId>hibernate-annotations</artifactId>
                                   <version>3.2.1.ga</version>
                                  </dependency>
                                  


                                  • 14. Re: Maven Archetype for Seam?
                                    Anders Andersen Newbie

                                    Thanks for the hint,
                                    I can still not make it work.
                                    I have tried it on and off, and it is deeply fustrating to work with seam.
                                    Tasks that should seem simple turns out to be strange all the way.

                                    I now want to build the dvdstore and pack it exactly as the ant build does.
                                    But then the meaning of it all vanish.
                                    On the other hand I am never going to use any software that cannot build by maven any longer.

                                    A few fustrations:
                                    1) the application.xml is version 5. My maven plugin will not accept 5 or 1.5 as version.
                                    2) is jboss-seam.jar really an ejb module ????
                                    3) artifact like hibernate-all.jar what is that ?? And where does that come from??

                                    Thinking about how simple and beautifull seam could be using maven just fustrates double seeing all this ant trash.