Disc: What maven can do is not a waste of traffic here. You can google everything on your own. This is just a simple entry. maven documentation is quite detailed. it is meaningless to repeat too much here. After reading this article, let's take a look at the documentation.
Context: Windows 7, maven3.0.5
Step:
1. Install maven
1.1 install maven (Quick Start http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
2. Create a maven Project
3. Add the source file to the jar File
1) enter the following command in the command line:
C: \ Users \ Administrator \ Desktop> mvn archetype: generate-DarchetypeArtifactId = maven-archetype-quickstart-DgroupId = freecoop-DartifactId = fir1_vnapp
Archetype: generate: Create a project prototype
-DarchetypeArtifactId: use the template provided by maven to create the desired value: http://maven.apache.org/guides/introduction/introduction-to-archetypes.html
-DgroupId: This is your project group Id. You can see the corresponding value in your local repository.
-DartifactId: Project name
The system will ask you to enter a layout number. There is a 1.0-SNAPSHOT in front. If you do not enter anything, this will be the default version number. We will enter 1 as our first version.
Here we will see a firnet vnapp project on the desktop, which is the first simple project we created using maven.
There is a pom. xml file in firenzvnapp to indicate this maven project.
<Project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<ModelVersion> 4.0.0 </modelVersion>
<GroupId> freecoop </groupId>
<ArtifactId> fir1_vnapp </artifactId>
<Packaging> jar </packaging>
<Version> 1 </version>
<Name> fir1_vnapp </name>
<Url> http://maven.apache.org </url>
<Dependencies>
<Dependency>
<GroupId> junit </groupId>
<ArtifactId> junit </artifactId>
<Version> 3.8.1 </version>
<Scope> test </scope>
</Dependency>
</Dependencies>
</Project>
Directory structure:
Maven details: click here
Maven: click here
Maven 3.1.0 release, Project Build Tool
Install Maven in Linux
Maven3.0 configuration and simple use
Set up sun-jdk and Maven2 in Ubuntu
Get started with Maven