Idea Maven installation and installation

1maven

(1) maven Introduction

Maven meaning: Maven Project Object Model (POM) Project Object Model , can be constructed by a short description of the project information management, reporting and documentation of software project management tools .

(2) use

Maven advantages :

a) Automatic Construction

  1. Cleanup code : equivalent to our running CLEA the n- effect
  2. Automatically compile : can we automate compilation ( similar to executing javac generated class file )
  3. Complete the test : to achieve test function, help complete
  4. Generate reports : can more easily achieve the management of the project
  5. Packaging : Ordinary project to fight jar package, Web projects labeled as war package
  6. Project deployment : only one command mvn jetty: run to achieve the project's deployment 

b) jar package dependency management

 

Automatically introducing a corresponding dependencies

 

c) contract program

maven structure            
                
    src / main / java ---------------------- discharge java code        
                
    src / main / resources ------------- --- put the resource file configuration file        
                
    src / test / java ---------------- put the test code        
                
    src / test / resources ---------- put to use test profiles 

(3) Installation

a) Download JDK Download : http://www.oracle.com/technetwork/java/javase/downloads/index.html    

     Mavenhttp://maven.apache.org/download.html  

b) an environment variable configuration

c) checks for success

mvn -v detection is successful

mvn automatically generates two folders : C: \ Users \ Administrator \   .m2 \ repository local repository directory

d) an access path configuration repository

 

MAVEN_HOME / conf / settings.xml global

Xml copy it over path

 

~ User root path C: \ the Users \ Leven / .m2 / the settings.xml single user , modify user profile

 

Increase <localRepository> F: \ OpenSource \ maven \ repository-teacher \ repository-teacher ( warehouse pack Road King) </ localRepository>

 

 

 f) maven commonly used commands

1. Open cmd command line, enter the Hello project root execute mvn compile command to view the root directory changes                    
2.cmd continue to enter mvn clean command, and check again root of the change                    
3.cmd the entry mvn clean compile command to view the root directory change                    
. 4 **** cmd entry mvn clean test in order to see the root of the change                    
5 **** cmd entry mvn clean package in order to see the root of the change.                    
6 **** in cmd entry mvn source:. jar command to view the changes in the root directory, source package                    
7.cmd enter mvn clean site in order to view the changes in the root directory                    
8. **** cmd enter mvn install in order to view the changes in the local warehouse                    
9. **** generate the required Eclipse 2 file the Eclipse mvn: the Eclipse                    
10.maven pack command does not execute test cases                    
11 **** mvn package -Dmaven.test.skip = true.                    

2.idea installation

(1) extracting files

(2) bin / application under setup64

(3) into the hosts file: C: \ Windows \ System32 \ drivers \ etc \ hosts

the "0.0.0.0 account.jetbrains.com" added to the hosts file

Remember permission to modify the hosts

(4) .http: //idea.lanyus.com/ registration code to paste

(5) establish a test project proves successful

 

Guess you like

Origin www.cnblogs.com/13438145925xiaozheng/p/11229258.html