Adam Bien's Weblog
Kickstarting Real World Java EE 6 Projects With Maven 3
- Install maven 3
- Execute:
mvn archetype:generate - Search for: webapp-javaee6. Choose it by entering the corresponding number (currently 268, but it can change at any time) to the wizard.
- Answer the remaining questions (groupId, artifactId, use the highest archetype version)
- If you plan to write some JUnit tests, replace the Java EE 6 API dependency with appserver implementation.
- Open the project with NetBeans 7 (Java EE). Start with e.g. EJB 3.1
- Click on the project and "Run" it. NetBeans 7 will start the bundled GlassFish 3.1 and deploy the application. JBoss 6 is supported as well, but has to be downloaded separately.
There is no need to use
mvn archetype:generate first. You could start straight with NetBeans 7 as well. NetBeans 7 also uses Maven 3 archetypes to generate the project structure for you. It even tries to download the newest artifact version from the maven repo. There is no (proprietary) secret sauce.
[See also page 132, chapter "Build and Deployment" in Real World Java EE Night Hacks--Dissecting the Business Tier. X-ray was also started with mvn archetype:generate].
Posted at 09:44AM May 26, 2011 by Adam Bien in Real World Java EE Patterns - Rethinking Best Practices | Comments[8] | Views/Hits: 13299
NEW Workshop: "JPA, NoSQL, Caching, Grids and Distributed Caches with Java EE 7", May 7th, 2013, Airport Munich
A book about rethinking Java EE Patterns
Tweet Follow @AdamBien

Hi Adam... there is a misleading (*lol*) typo in the title of this post...
Posted by Robert Herschke on May 26, 2011 at 10:30 AM CEST #
@Robert,
typo? :-)
adam
Posted by Adam Bien on May 26, 2011 at 10:55 AM CEST #
did you mean kickstarting instead of kicktarting?
well "tarting" is a funny happy accident too ;-)
Posted by Robert Herschke on May 26, 2011 at 11:15 AM CEST #
processs taught ok!!!
Posted by Lava Kafle on May 26, 2011 at 11:18 AM CEST #
This is why I love Netbeans. No secret sauce, no special project settings magic; the easiest way to set up a headless build for your project !
Such simplicity is a real achievement Bravo Netbeans team.
Posted by Donny on May 26, 2011 at 10:17 PM CEST #
"Search for: webapp-javaee6 .. (currently 268..)" - that's the best joke on usability I've heard for a while :))
Posted by Kristof Jozsa on May 27, 2011 at 01:08 AM CEST #
@Kristof,
if you already know the name: "webapp-javaee6" - you can directly enter it.
Hence NetBeans uses exactly the same mechanism, I always use NetBeans for initial setup. That is very usable - only few clicks :-)
thanks!,
adam
Posted by Adam Bien on May 27, 2011 at 09:40 AM CEST #
Adam this would be a much more helpful post if you could provide the filter string here.
Something like:
mvn archetype:generate -Dfilter=org.apache:struts
http://maven.apache.org/archetype/maven-archetype-plugin/usage.html
Posted by dhawan on July 21, 2012 at 09:22 AM CEST #