maven发布SNAPSHOT版本到私服仓库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <servers> <server> <id>nexus-releases</id> <username>admin</username> <password>admin******</password> </server> <server> <id>nexus-snapshots</id> <username>admin</username> <password>admin******</password> </server> </servers>
<mirrors> <mirror> <id>nexus</id> <mirrorOf>central</mirrorOf> <url>http://nexus.mycompany.com/nexus/content/groups/public</url> </mirror> </mirrors>
|
然后本项目的pom.xml文件中添加以下配置
1 2 3 4 5 6 7 8 9 10 11 12
| <distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus central Repository</name> <url>http://nexus.mycompany.com/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://nexus.mycompany.com/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
|
最后执行命令mvn clean deploy就ok了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| E:\git\service\MapUtil>mvn clean deploy [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building credit-service-MapUtil 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ credit-service-MapUtil --- [INFO] Deleting E:\git\service\MapUtil\target [INFO] [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ credit-service-MapUtil --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ credit-service-MapUtil --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 24 source files to E:\git\service\MapUtil\target\classes [INFO] [INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ credit-service-MapUtil --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory E:\git\service\MapUtil\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ credit-service-MapUtil --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ credit-service-MapUtil --- [INFO] No tests to run. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ credit-service-MapUtil --- [INFO] Building jar: E:\git\service\MapUtil\target\credit-service-MapUtil-1.0.0-SNAPSHOT.jar [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) @ credit-service-MapUtil --- [INFO] Installing E:\git\service\MapUtil\target\credit-service-MapUtil-1.0.0-SNAPSHOT.jar to C:\Users\Administrator\.m2\repository\com\caiyi\huishuaka\service\credit-service-MapUtil\1.0.0-SNAPSHOT\credit-service-MapUtil-1.0.0- SNAPSHOT.jar [INFO] Installing E:\git\service\MapUtil\pom.xml to C:\Users\Administrator\.m2\repository\com\caiyi\huishuaka\service\credit-service-MapUtil\1.0.0-SNAPSHOT\credit-service-MapUtil-1.0.0-SNAPSHOT.pom [INFO] [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ credit-service-MapUtil --- Downloading: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/maven-metadata.xml Downloaded: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/maven-metadata.xml (805 B at 2.1 KB/sec) Uploading: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/credit-service-MapUtil-1.0.0-20160831.091851-271.jar Uploaded: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/credit-service-MapUtil-1.0.0-20160831.091851-271.jar (92 KB at 362.1 KB/sec) Uploading: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/credit-service-MapUtil-1.0.0-20160831.091851-271.pom Uploaded: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/credit-service-MapUtil-1.0.0-20160831.091851-271.pom (2 KB at 11.2 KB/sec) Downloading: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/maven-metadata.xml Downloaded: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/maven-metadata.xml (309 B at 3.6 KB/sec) Uploading: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/maven-metadata.xml Uploaded: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/1.0.0-SNAPSHOT/maven-metadata.xml (805 B at 7.0 KB/sec) Uploading: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/maven-metadata.xml Uploaded: http://nexus.mycompany.com/nexus/content/repositories/snapshots/com/caiyi/huishuaka/service/credit-service-MapUtil/maven-metadata.xml (309 B at 2.1 KB/sec) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.304 s [INFO] Finished at: 2016-08-31T17:18:52+08:00 [INFO] Final Memory: 22M/186M [INFO] ------------------------------------------------------------------------
|