此内容没有您所选择的语言版本。
7.2.2. Create an EJB Archive Project in Maven
		This task demonstrates how to create a project using Maven that contains one or more enterprise beans packaged in a JAR file.
	
Prerequisites:
- Maven is already installed.
- You understand the basic usage of Maven.
Procedure 7.2. Create an EJB Archive project in Maven
- Create the Maven project An EJB project can be created using Maven's archetype system and the- ejb-javaee6archetype. To do this run the- mvncommand with parameters as shown:- mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ejb-javaee6 - mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ejb-javaee6- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Maven will prompt you for the- groupId,- artifactId,- versionand- packagefor your project.- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Add your enterprise beans Write your enterprise beans and add them to the project under the- src/main/javadirectory in the appropriate sub-directory for the bean's package.
- Build the project To build the project, run the- mvn packagecommand in the same directory as the- pom.xmlfile. This will compile the Java classes and package the JAR file. The built JAR file is named- artifactId-version.jarand is placed in the- target/directory.
		RESULT: You now have a Maven project that builds and packages a JAR file. This project can contain enterprise beans and the JAR file can be deployed to an application server.