maven打包項目jar並上傳到本地倉庫

C:\Users\Administrator\Desktop>mvn archetype:generate -DgroupId=yxyu.xx -Dartifamaven

ctId=xx1 -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=falsui

espa

[INFO] Scanning for projects...orm

[INFO]xml

[INFO] ------------------------------------------------------------------------ip

[INFO] Building Maven Stub Project (No POM) 1get

[INFO] ------------------------------------------------------------------------it

[INFO]io

[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sourcesast

@ standalone-pom >>>

[INFO]

[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources

@ standalone-pom <<<

[INFO]

[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom --

-

[INFO] Generating project in Batch mode

[INFO] -------------------------------------------------------------------------

---

[INFO] Using following parameters for creating project from Old (1.x) Archetype:

 maven-archetype-quickstart:1.0

[INFO] -------------------------------------------------------------------------

---

[INFO] Parameter: groupId, Value: yxyu.xx

[INFO] Parameter: packageName, Value: yxyu.xx

[INFO] Parameter: package, Value: yxyu.xx

[INFO] Parameter: artifactId, Value: xx1

[INFO] Parameter: basedir, Value: C:\Users\Administrator\Desktop

[INFO] Parameter: version, Value: 1.0-SNAPSHOT

[INFO] project created from Old (1.x) Archetype in dir: C:\Users\Administrator\D

esktop\xx1

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 01:07 min

[INFO] Finished at: 2015-06-26T11:44:02+08:00

[INFO] Final Memory: 10M/26M

[INFO] ------------------------------------------------------------------------


C:\Users\Administrator\Desktop>cd xx1


C:\Users\Administrator\Desktop\xx1>mvn clean install

[INFO] Scanning for projects...

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building xx1 1.0-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xx1 ---

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ xx1 ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e

. build is platform dependent!

[INFO] skip non existing resourceDirectory C:\Users\Administrator\Desktop\xx1\sr

c\main\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ xx1 ---

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. buil

d is platform dependent!

[INFO] Compiling 1 source file to C:\Users\Administrator\Desktop\xx1\target\clas

ses

[INFO]

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ xx

1 ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e

. build is platform dependent!

[INFO] skip non existing resourceDirectory C:\Users\Administrator\Desktop\xx1\sr

c\test\resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ xx1 ---


[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. buil

d is platform dependent!

[INFO] Compiling 1 source file to C:\Users\Administrator\Desktop\xx1\target\test

-classes

[INFO]

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ xx1 ---

[INFO] Surefire report directory: C:\Users\Administrator\Desktop\xx1\target\sure

fire-reports


-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Running yxyu.xx.AppTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec


Results :


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


[INFO]

[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ xx1 ---

[INFO] Building jar: C:\Users\Administrator\Desktop\xx1\target\xx1-1.0-SNAPSHOT.

jar

[INFO]

[INFO] --- maven-install-plugin:2.4:install (default-install) @ xx1 ---

[INFO] Installing C:\Users\Administrator\Desktop\xx1\target\xx1-1.0-SNAPSHOT.jar

 to C:\Users\Administrator\.m2\repository\yxyu\xx\xx1\1.0-SNAPSHOT\xx1-1.0-SNAPS

HOT.jar

[INFO] Installing C:\Users\Administrator\Desktop\xx1\pom.xml to C:\Users\Adminis

trator\.m2\repository\yxyu\xx\xx1\1.0-SNAPSHOT\xx1-1.0-SNAPSHOT.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 3.276 s

[INFO] Finished at: 2015-06-26T11:51:16+08:00

[INFO] Final Memory: 11M/28M

[INFO] ------------------------------------------------------------------------


使用:

在C:\Users\Administrator\.m2\repository\yxyu\xx\xx1找到maven-metadata-local.xml

<?xml version="1.0" encoding="UTF-8"?>

<metadata>

  <groupId>yxyu.xx</groupId>

  <artifactId>xx1</artifactId>

  <versioning>

    <versions>

      <version>1.0-SNAPSHOT</version>

    </versions>

    <lastUpdated>20150626035116</lastUpdated>

  </versioning>

</metadata>

因而該怎麼用就怎麼用了!

相關文章
相關標籤/搜索