Friday, October 1, 2010

Starting a Wicket project with maven

You have just started creating web applications and you have decided that you are going to use wicket. Here is how to get started:

Requirements:
  • Java 5+ jdk
  • Eclipse IDE
  • Maven2
I assume you know how to install the above. Please see the respective documentations.

To Create your first wicket web application, Open the terminal and type the following :
 
mvn archetype:generate -DarchetypeGroupId=org.apache.wicket 
         -DarchetypeArtifactId=wicket-archetype-quickstart 
         -DarchetypeVersion=1.4.12        
         -DgroupId=com.mycompany  
         -DartifactId=myproject

 


After running the above maven command, you now have a ready to run wicket project.

To run it, type
 mvn jetty:run

Open your browser and type :

 http://localhost:8080/myproject


Your have your wicket project running. You now need to mount it into eclipse so that you can continue with the rest of the development.

To do so, type :
 mvn eclipse:eclipse 

You have now converted your project into an eclipse project.
Open your eclipse ide and import the project.