Maven3.0 configuration and simple use

Source: Internet
Author: User

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

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.