Maven FAQ and code snippets for beginners

I have been using Maven with eclipse for two years and have found many simple and useful maven plugins and features like automatically downloading java sources, javadocs, running in an embedded container, importing the project to eclipse. Here’s a list of some useful code snippets and use case scenarios that I hope other maven beginners would find useful.

Maven Cargo JBoss

This article shows how to deploy your war to JBoss using maven and cargo. It also shows how to integration test your JBoss applications using selenium by automatically deploying the war, running the tests and then automatically undeploying the war. All using maven, selenium and cargo!

It is a good practice to startup JBoss outside the scope of maven and use cargo to redeploy your app. Cargo uses the jmx-console over http to deploy and no file path configuration is needed! This only works with JBoss running locally as a file: reference to the war file is passed over http.

See articles for details and code snippets.

Maven Selenium

Our goal: compile the app run non-selenium unit tests package your app into a .war file start a test container (jetty or tomcat) deploy your app to the test container start a browser point the browser to the app running in the test container test your application through the browser. these tests are junit tests [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes