Maven 构建一个工程

在maven项目下,输入 mnv package命令就可以对项目进行构建了。

如果是第一次使用maven, 那么maven将会下载一些文件到本地。[code]D:\workdir\testing\my-app>mvn package
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\workdir\testing\my-app\src\main\re
sources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1 source file to D:\workdir\testing\my-app\target\classes
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\workdir\testing\my-app\src\test\re
sources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 1 source file to D:\workdir\testing\my-app\target\test-classes
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: D:\workdir\testing\my-app\target\surefire-repo
rts


T E S T S

Running com.mycompany.app.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.125 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-project/2.0.7/
maven-project-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven/2.0.7/maven-2.
0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-settings/2.0.7
/maven-settings-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-model/2.0.7/ma
ven-model-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-profile/2.0.7/
maven-profile-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-artifact-manag
er/2.0.7/maven-artifact-manager-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-repository-met
adata/2.0.7/maven-repository-metadata-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-artifact/2.0.7
/maven-artifact-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-registr
y/2.0.7/maven-plugin-registry-2.0.7.pom

Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-utils/1.4.
9/plexus-utils-1.4.9.jar

[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: D:\workdir\testing\my-app\target\my-app-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22 seconds
[INFO] Finished at: Wed May 05 16:32:37 EDT 2010
[INFO] Final Memory: 8M/22M
[INFO] ------------------------------------------------------------------------
D:\workdir\testing\my-app>[/code][attach]866[/attach]