MAVEN is needed in recent project development . Maven This thing I taught myself 2 years ago. It has not been used in the past 2 years. Now the project needs, only to re-go over the cooked meat. Re-learn. After an afternoon of struggle, an afternoon of various problems of various solutions, finally set up, all the way hard ah, here to everyone said is, I use is Eclipse3.7,indigo. This version of install Maven seems to be experiencing problems with other versions of installing Mavan .
first of all to tell you about my tool and version number;
Eclipse3.7,indigo.
Eclipse maven Plugin:
Subclipse 1.6.x-http://subclipse.tigris.org/update_1.6.x
gef-http://download.eclipse.org/tools/gef/updates/releases/
m2eclipse-http://download.eclipse.org/technology/m2e/releases/1.3/1.3.1.20130219-1424
locally installed maven:apache-maven-3.2.5-bin
OK, let's go to the following installation process to share.
first go to the Http://maven.apache.org/maven official website to download. The version number looks at its own choice.
First step: Configure the local Maven
1. Unzip the apache-maven-3.2.5-bin;
2. then go to the directory under the conf folder to edit the settings.xml;
Modify the <localRepository>D:\develop\maven\repository</localRepository>
D:\develop\maven\repository: This directory is your maven local repository.
3. Configure Environment Variables
the variable value is your maven installation directory;
Add Path environment variable:D:\develop\maven\apache-maven-3.2.5-bin\apache-maven-3.2.5\bin; You can also use a notation, I am accustomed to this writing, intuitive.
4. test whether the installation OK
CMD- -and maven--version output version information means you're successful.
Step Two: Eclipse installation maven Plugins
Eclipse installs maven plugins in 2 ways that everyone knows, offline, online. This depends on your personal choice.
I choose the online installation. Installing the Maven plugin online requires SVN and GEF to be installed, because maven needs both of these support.
helpàInstall new softwareàadd
First install svn, then GEF, and finally M2eclipse;
here is the installation process directly next to it. Address at the beginning of the article. ↑
M2eclipse 's online installation address, I looked for a long time, especially the e3.7 version. Hard!
Restart Eclipse After the installation is complete .
a Maven menu appears to the left of Eclipseàwindow . Here is the MAVEN plugin installed successfully, now we need to further configure the Maven plugin, open dry!!!
A)
above the red line is to choose their own local maven installation directory;
below the red line is the setting.xml that chooses your local maven
the Upper Red Line is the setting.xml that chooses your local maven
below the red line is to choose your own local maven repository
so far, maven all installed successfully; Now we need to create a simple project to verify that our configuration is successful!
Step three: The final step, create maven Web to test the project;
New Project
Select Maven Project
Direct Next
Select
Group Id:org.apache.maven.archetypes
Artifactid Id:maven-archetype-webapp
then next
Group ID: Read English can understand its meaning,group: organization, group meaning; here the group ID is the identity of the team;
Artifactid ID: Project unique identification
then Finish
2. Configure Project
A) Create 4 source Folder under Java Resources, respectively:
Src/main/java src/main/resources --where we store our code
Src/test/java src/test/resources --where we compile our code
B) Java Build path
will Src/main/java and src/main/resources below output folder edit, click on the right Edit, Select target/ Classes ;
will be Src/test/java and the src/test/resources the following output Folder to edit, click on the right Edit, Select target/test-classes;
then change the JDK for your project ;
change the current project to a project that Tomcat can run
Project , right --Propertiesàproject Facets ;
Select Dynamic Web Module; such as:
version with jdk.
In this step, your project will appear in a webcontent folder, the contents of this folder directly into the Src/main/webapp inside, and then the folder can be deleted.
One final step:
Project - right --DeploymentAssembly;
Here is the project deployment package output place, we put test Delete, and just webcontent Delete, then right-click on add, select Src/main/webapp As our / catalogue;
then in this add->java Build Path Entries à Maven Dependencies à Finish
This step is to package the jar package in web-inf/lib .
So far all over, maven install. Then configure Tomcat to run it.
finally: I wish you success!!!
MAVEN configuration _eclipse Creating Maven_maven plug-in configuration