MAVEN Installation
To download maven on the official website, the following links:
http://maven.apache.org/download.cgi#
Choose to download binary zip archive
Unzip to local, before installing MAVEN, make sure that you have installed Jdk,cmd input java-version Verify that the JDK is installed, as follows for my native JDK version:
Set Environment variables:
The Maven_home variable is set to D:\maven\apache-maven-3.3.9, which is the downloaded MAVEN package decompression path;
Add%m2_home%\bin in front of the path variable ;
M2eclipse Installation
The eclipse version I use on this machine is as follows:
Eclipse IDE for Java developers
Version:mars.1 Release (4.5.1)
has been integrated m2eclipse, if not integrated, installation is also very simple, there are two ways,
Get m2eclipse and install from Eclipse Marketplace:
Install M2eclipse with Eclipse's install new software, such as
After installing the m2eclipse, we typically do not use the eclipse-brought maven, but instead use the externally installed MAVEN version of our own, which you can only configure on Eclipse, as shown in
Start using MAVEN to manage project
Points:
- Create a new STRUTS2 Web project that you can run
- Modular, one parent MAVEN project + two sub maven modules
- Build Project Site
- Generate Test Reports
- Generate Javadoc
First, create a new MAVEN parent project, skip the prototype selection,
Select Pakaging as Pom
Then right-select Maven on the parent project and create a new module Webapp-core,
Continue with new module Webapp-web
At this point, we have a parent project and two sub-modules, as shown in the project:
Next began to write the various modules of the demo code and POM files, here is not detailed, interested in directly download the project code, as follows:
Http://files.cnblogs.com/files/chenpi/webapp.zip
Run the Web project
Right-click to run, goals set to Tomcat7:run, the effect is as follows:
View Project Site
Right-click to run, goals set to site, the effect is as follows:
You can view project overview, project members, project-dependent jar packages, etc.
To view the test report:
View Java doc
"Getting Started with maven" using Maven on Eclipse