XP Simple MAVEN project build (does not include maven how to install)
Source: Internet
Author: User
First, at the command line, use the MAVEN archetype plug-in to create a project
MVN archetype:create-dgroupid=org.sonatype.mavenbook.ch03-dartifactid=simple-dpackagename= Org.sonatype.mavenbook
Comments:
1), MVN is the order of Maven
2), Archetype:create is a MAVEN goal (goal), similar to one of Ant's target, which is to create a project quickly using archetype. Archetype is the prefix of the plugin, create is the target.
3),-dname=value such a key value pair is the parameter to be passed into the target
Ii. Building the directory structure of the project
Simple
Simple/src
Simple/src/main
Simple/src/main/java
Simple/src/main/java/org/sonatype/mavenbook/app.java
Simple/src/test
Simple/src/test/java
Simple/src/test/java/org/sonatype/mavenbook/apptest.java
Simple/pom.xml
Comments:
1), the source of the project in the Src/main directory
2), the project test case is placed in the Src/test directory
3, the Pom.xml file contains its Project object Model (POM), which describes the project, configures Plug-ins, and declares dependencies
Third, packaging project MVN install
Enter the directory where the Pom.xml file is located (also known as the Simple directory), and execute mvn install on the command line, and see a single target directory in the simple directory
The generated Simple-1.0-snapshot.jar can be found in the target directory
Test jar Package
In the simple directory, execute the following command:
JAVA-CP Target/simple-1.0-snapshot.jar org.sonatype.mavenbook.App
You will see the console has hello world! output and the surface package is successful.
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