Maven is simple to understand

[A definition]
1, Maven Jewish word for knowledge accumulation. I think it is a simple way to share jar wrapped in multiple projects;
2, build Maven can be managed by a short description of the project, reports and documents;
3, Maven is a project management tools, including:
(A) a project object model (the model Object the project),
(B) a set of standards, a project life cycle (the lifecycle the project),
(C) a dependency management system (the dependency the system management),
(D) is used to define the operating life cycle stage (phase) of the plug (plugin) logical destination (goal) is.
4, Maven has a lifecycle, when you run mvn install is called.
This command tells Maven to perform a series of sequential steps, until it reached the lifecycle.
[Second, the commonly used commands]
6, Maven project: mvn archetype: generate
compile the source code: mvn compile
publish the project: mvn deploy
compiling test source code: mvn test-compile
run application unit tests: mvn test
generation project-related information website: mvn site
generates clear results in the project directory: mvn clean
according to jar the project generated: mvn package
installed in the jar on the local Repository: mvn install
Generate eclipse project file: mvn eclipse: eclipse
started jetty Services: mvnjetty: run
start tomcat service: mvntomcat: run
repackaged after clearing the previous package, to skip the test class: mvn clean package -Dmaven.test.skip = true:
[three , using Maven]
7 disposed Maven environment variables (slightly)
8, Maven test configuration:
A) to re-enter the command line (DOS window) mode, input MAVEN_HOME%% echo
B) input mvn -version, under normal circumstances and displays maven jdk version number
[four, Maven application]
9, we will create a lot of projects at work, there will always be some common projects between the jar package, before I always put all the jar packages are replicated in each project again. This is clearly not good, the same file on your hard disk to save a lot of points, but there is no jar package are compatible like commons-io-1.4.jar and commons-io-1.5.jar version of the method. If all references to the jar package of projects need to be updated, you must modify one project.

Maven is simple to understand

10, maven repository is a good solution to these problems, it creates a local repository on each machine, the machine all the project dependencies maven jar package unified management together, and these jar package with "coordinate" to unique identification, so that all maven projects do not need to copy as before as the jar package to the lib directory.
[Five, Idea Maven integration]
Maven is simple to understand

Maven is simple to understand

Guess you like

Origin blog.51cto.com/13479739/2464064