Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Java EE 7 Maven Archetype

DZone's Guide to

Java EE 7 Maven Archetype

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

For those of us doing Java EE development with Maven (which by my own account as a former consultant is pretty much all Java EE/GlassFish adopters), Archetypes can be a great productivity boost, especially while getting started. You will be pleased to know that there is already a Java EE 7 Maven Archetype out there in the https://nexus.codehaus.org/content/repositories/snapshots/ repository (courtesy of GlassFish of course).

You can use it directly from the Maven command-line like so:

mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes 

    -DarchetypeArtifactId=webapp-javaee7 

    -DarchetypeVersion=0.3-SNAPSHOT 

    -DarchetypeRepository=https://nexus.codehaus.org/content/repositories/snapshots/ 

    -DgroupId=your_group_id 

    -DartifactId=your_artifact_id 

    -Dversion=your_version

    -Dpackage=your_package

    -Darchetype.interactive=false 

    --batch-mode 

    --update-snapshots 

    archetype:generate

If you prefer NetBeans, you can do that too. Just define a new repository with the URL https://nexus.codehaus.org/content/repositories/snapshots/ under "Maven Repositories" on the "Services" tab. Then proceed to "New Project -> Maven -> Project from Archetype" and enter "webapp-javaee7" into the search box. Select the 0.1-SNAPSHOT and click "Finish".

Either way, once the project is generated, you can of course tweak the POM and source code to meet your needs. It should be pretty straightforward - give me a shout if you need help getting started. Happy hacking!

 

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Published at DZone with permission of Reza Rahman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}