Book Image

Mastering Apache Maven 3

Book Image

Mastering Apache Maven 3

Overview of this book

Table of Contents (16 chapters)
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

EJB archives with the archetype plugin


Here, we will discuss how to create a Maven Enterprise JavaBeans (EJB) project using the ejb-javaee6 archetype developed by Codehaus, which is a collaborative environment for building open source projects:

$ mvn archetype:generate -B
                  -DgroupId=com.packt.samples
                  -DartifactId=my-ejbapp
                  -Dpackage=com.packt.samples.ejbapp
                  -Dversion=1.0.0
                  -DarchetypeGroupId=org.codehaus.mojo.archetypes
                  -DarchetypeArtifactId=ejb-javaee6
                  -DarchetypeVersion=1.5

The previous command produces the following skeleton project. You can create your EJB classes inside src/main/java/com/packt/samples/ejbapp/:

my-ejbapp
      |-pom.xml
      |-src/main/java/com/packt/samples/ejbapp/
      |-src/main/resources/META-INF/MANIFEST.MF

If you look at the following pom.xml file inside my-ejbapp, you will notice that maven-ejb-plugin is used internally to produce the EJB...