Over a million developers have joined DZone.
Platinum Partner

Java EE 7 Maven Archetype

· Java Zone

The Java Zone is brought to you in partnership with AppDynamics. Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems.

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!

 

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.

Topics:

Published at DZone with permission of Reza Rahman , DZone MVB .

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}