Execute the following command to create the project skeleton:
MVN archetype:generate-darchetypegroupid=org.jboss.spec.archetypes-darchetypeartifactid= jboss-javaee6-webapp-ear-archetype-darchetypeversion=7.1.1.final-dgroupid={your GroupID}-DartifactId={ Your Artifactid}-dversion=1.0-snapshot
After the project has been generated, to support deployment operations on wildfly, you need to add the Wildfly-maven-plugin method as follows:
Locate the build node for pom.xml under the root directory and add the following:
<build> ... <plugins> ... <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId> wildfly-maven-plugin</artifactid> <version>1.0.1.Final</version> </plugin> ... </plugins> ... </build>
Then switch to the ear directory, locate the Pom.xml file, and add the following:
<plugin><groupid>org.wildfly.plugins</groupid><artifactid>wildfly-maven-plugin</ Artifactid></plugin
Also, to be able to package, add it under Build:
<defaultGoal>package</defaultGoal>
OK is done. If you want to develop on this basis, you also need to modify the Persistence.xml and *.ds.xml files.
Deployment method:
MVN Clean INSTALLCD ***-earmvn Wildfly:deploy