一、download nexus
二、配置環境
apache-maven-3.3.9
JDK 1.8
這一步須要配置電腦屬性高級設置,環境變量。
參考:
win +R 進入cmd,進入nexus所在的bin目錄下,輸入nexus /run便可
直接發jar包到私服
參考文檔
部署在90環境
一、地址:F:\nexus-3.2.0-01-win64\nexus-3.2.0-01\bin
版本未穩定前,用<version>1.0-SNAPSHOT</version>
表示快照,能夠頻繁更新版本。大版本號不變。
設置隨機啓動
sc create uut-maven-nexus binpath= F:\nexus-3.2.0-01-win
64\nexus-3.2.0-01\bin\nexus.exe type= own start= auto displayname= uut-maven-nex
us
命令行
參考文檔
經過命令將內容上傳到私服
【命令是沒有換行,此處換行是爲了好看】
mvn deploy:deploy-file
-DgroupId=com.uut
-DartifactId=BASE_DOMAIN
-Dversion=1.0
-Dpackaging=jar
-Dfile=D:\java\UUT2.0_NEW\trunk\BASE\BASE_DOMAIN\target\BASE_DOMAIN-1.0.jar
-Durl=http://192.168.18.90:8081/repository/uut_repository/
-DrepositoryId=uut-repository
坑1:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from http://192.168.18.90:8081/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from/to nexus (http://192.168.18.90:8081/repository/maven-public/): Failed to connect to /192.168.18.90:8081
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from http://192.168.18.90:8081/repository/maven-public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from/to nexus (http://192.168.18.90:8081/repository/maven-public/): Failed to connect to /192.168.18.90:8081
解決方案:是由於私服掛了,1)須要重啓私服 到私服所在目錄,執行nexus restart;2)刪除repository下的org.apache.maven.archetypes目錄
坑2:
An internal error occurred during: "JPA Project Post-Clean Build Event Handler: E_CONTRACT".
org.eclipse.jpt.common.utility.internal.iterable.IterableTools.cloneSnapshot(Ljava/util/List;)Lorg/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneListIterable;
坑3:
An internal error occurred during: "JPA Facet File Change Event Handler: E_CONTRACT".
org.eclipse.jpt.common.utility.internal.iterable.IterableTools.cloneSnapshot(Ljava/util/List;)Lorg/eclipse/jpt/common/utility/internal/iterable/SnapshotCloneListIterable;
坑4:
路徑中不能存在空格或者-。