Java Projects
Create a Javastudy project with the following steps:
1. Switch to directory on command line
CD D:\devworkspace\ecpoxyworkspace
2. Execute Create command
MVN archetype:generate-dgroupid=com.oscar999-dartifactid=javastudy-darchetypeartifactid= Maven-archetype-quickstart-dinteractivemode=false
This step will take a long time.
The completed directory structure is created as follows:
Generates Pom.xml and code directories, and tests directories. and have the test code App.java
3. Import Eclipse
To the Engineering directory CD D:\devworkspace\ecpoxyworkspace\JavaStudy
Perform MVN eclipse:eclipse
After you execute the above command, it automatically downloads updates related resources and configuration information (it will take some time to wait) and produces all the project files required by the Eclipse IDE.
When the execution is complete, the. classpath and. Project two files are created.
To import the project into the Eclipse IDE, select "File-> Import ...-> general->existing Projects into Workspace"
If you do not perform this step, you cannot import it in project mode.
Web Project
1.  MVN Archetype:generate-dgroupid=com.oscar999-dartifactid=webstudy- Darchetypeartifactid=maven-archetype-webapp-dinteractivemode=false
Generate project Structure
2. Import Eclipse The
mvn eclipse:eclipse-dwtpversion=2.0
-dwtpversion=2.0 tells Maven to convert the project to Eclipse's Web project (WAR) instead of the default Java project (JAR).
eclipse ide–file-> Import ...-> general-> Existing Projects to workspace
Note: If you add the following section to the Pom.xml
<!--Eclipse Project-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
< Configuration>
<!--Always download and attach dependencies source code-->
<downloadSources> true</downloadsources>
<downloadJavadocs>false</downloadJavadocs>
<!--avoid type MVN eclipse:eclipse-dwtpversion=2.0-->
<wtpversion>2.0</wtpversion>
</configuration >
</plugin>
You can ignore the above-dwtpversion=2.0 parameters.
That is, MVN eclipse:eclipse,maven the import of this project into the Eclipse Web project