views:

32

answers:

1

What is the best Maven archetype to use on enterprise application in java using EJB and JAX-RS, considering that in a near future i will have to make a front-end in JSF2 using as the backend EJBs used with the JAX-RS?

+2  A: 

First of all, I personally think that there is no perfect archetype, archetypes are only a starting point and this is something important to keep in mind: use them as starting point.

Then, picking one or the other depends on the targeted packaging structure (and don't forget you can package EJBs in a WAR), what you plan to use, etc.

In your case, you might be interested by the following archetypes (from codehaus):

  • the ear-javaee6 (Archetype for creating Java EE 6 EAR)
  • the ejb-javaee6 (Java EE 6 ejb jar archetype)
  • the webapp-javaee6 (Java EE 6 web application archetype)

Or the following (from the Knappsack project)

  • jee6-basic (Empty application with just a bean that returns a message to a JSF page)
  • jee6-minimal (Includes a sample page to test JPA, JSF and validation)
  • jee6-sandbox (Comes with a JPA model pre-populated with data so you can experiment in a sandbox environment)
  • jee6-sandbox-demo (A working CRUD application project that shows off features of Java EE 6)
  • jee6-servlet-basic (Empty application that verifies that JSF is configured and can be run with an embedded Tomcat or Jetty instance from the command line)
  • jee6-servlet-minimal (Small application that verifies that JSF, JPA, CDI and validation is working and can be run with an embedded Tomcat or Jetty instance from the command line)

Or even the following JBoss archetypes:

  • jboss-javaee6-webapp (An archetype that generates a starter Java EE 6 webapp project)
  • weld-jsf-jee (Weld archetype for creating a Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included))
  • weld-jsf-jee-minimal (Weld archetype for creating a minimal Java EE 6 application using JSF 2.0, CDI 1.0 and EJB 3.1 (persistence unit not included))
  • weld-jsf-servlet-minimal (Weld archetype for creating an application using JSF 2.0 and CDI 1.0 for Servlet Containers (Tomcat 6 / Jetty 6))

Sorry, but without more details on your requirements, I can't be more precise. But at least, this will give you an overview.

Pascal Thivent
It quite simple, i want to hold the business code in the ejb, expose as an API through REST, after that make it available using JSF injecting the ejbs in the managedbeans.
Thiago Diniz
@Thiago Then you could start with something simple, like the `webapp-javaee6` or the `jee6-basic` archetypes.
Pascal Thivent