myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Building With Maven" by BrunoAranda
Date Mon, 12 Jun 2006 18:35:00 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by BrunoAranda:
http://wiki.apache.org/myfaces/Building_With_Maven

------------------------------------------------------------------------------
  
  The documentation will be put in the target/site folder of every subproject.
  
- == The MyFaces Archetype ==
- 
- There is a [http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
"Maven Archetype"] allows you to generate a template for a web application that uses !MyFaces,
based on the blank example application. So, creating the template of the application is as
easy as executing:
- 
- {{{
- mvn archetype:create -DarchetypeGroupId=org.apache.myfaces.maven -DarchetypeArtifactId=myfaces-archetype
-DarchetypeVersion=1.0-SNAPSHOT -DgroupId=myAppId -DartifactId=testApp
- }}}
- 
- In the future, the archetype will be located in a public repository in internet, but currently
if you want to use it you have to build it from sources.
- 
- ==== Getting and installing the plugin locally ====
- 
- To be able to use the archetype the first thing you should do is to checkout the myfaces
archetype source from the svn, using the command:
- 
- {{{
- svn co http://svn.apache.org/repos/asf/myfaces/maven/trunk/myfaces-archetype myfaces-archetype
- }}}
- 
- Now, let's install the plugin locally (this supposes that you have maven 2.x already installed).
Navigate to the plugin root folder and use the mvn install command:
- 
- {{{
- cd myfaces-archetype
- mvn install
- }}}
- 
- At this point, you have the plugin installed in your local system. You don't have to install
it again unless you want to update it.
- 
- ==== Creating a template for a web application ====
- 
- Now, using maven (anywhere in your file system) you can create a template for an application
that uses !MyFaces using the command:
- 
- {{{
- mvn archetype:create -DarchetypeGroupId=org.apache.myfaces.maven -DarchetypeArtifactId=myfaces-archetype
-DarchetypeVersion=1.0-SNAPSHOT -DgroupId=myAppId -DartifactId=testApp
- }}}
- 
- In this last command we are creating an application with groupId=myAppId and artifactId=testApp.
You can change that values to adapt your needs.
- 
- Finally, if we want to test the basic application created, just run the command:
- 
- {{{
- cd testApp
- mvn package
- }}}
- 
- And you will have your war created at testApp/target folder!
- 
- This whole process can save a lot of time while setting up a new web application. And what
is better, you have already the structure to use maven :-)
- 
- 
- ==== Jetty plugin ====
- 
- The Jetty6 plugin has been added to the pom.xml of the archetype.
- 
- {{{
- mvn -P jettyConfig clean jetty6:run
- }}}
- 
- This will create a war, launch the Jetty container and it will server your project at http://localhost:8080/testApp
- 
- 
- ==== IDE support ====
- 
- See ["Building MyFaces in your IDE"].
- 

Mime
View raw message