(轉)常用myeclipse設定
阿新 • • 發佈:2020-10-21
轉載於:http://w26.iteye.com/blog/1547096
1
下載Nexus
http://www.sonatype.org/nexus/go
2
安裝
解壓即可
D:\bisoft\tools
nexus-2.0.4-1
sonatype-work
3
配置環境變數
NEXUS_HOME=D:\bisoft\tools\nexus-2.0.4-1
PATH 新增 %NEXUS_HOME%\bin\jsw\windows-x86-64
$NEXUS_HOME/conf/nexus.properties 可修改基本配置資訊,如 sonatype-work 目錄位置.
nexus-work=${bundleBasedir}/../sonatype-work/nexus
4
故障解決方案:
The nexus-webapp service was launched, but failed to start.
環境變數|系統變數|JAVA_HOME & PATH.
注意是系統變數下,不是使用者變數.
5
執行
install-nexus.bat
console-nexus.bat
nexus start|stop
檢視日誌
%NEXUS_HOME%/logs/wrapper.log
6
進入Nexus管理介面
http://localhost:8081/nexus
管理員
賬號:admin
密碼:admin123
部署使用者:
deployment
deployment123
匿名使用者:
7
$NEXUS_HOME/conf/wrapper-override.conf 可重寫nexus服務配置.
8
啟用遠端索引下載
左邊| Repositories|選擇一個遠端代理倉庫|下邊Tab Configuration|Download Remote Indexes|true|Save|上邊選單Refresh.
預設有三個代理倉庫:
Maven Central repository
Apache Snapshot repository
Codehaus Snapshot repository
現在自動開始下載索引檔案.這個只會下載索引,不會下載JAR.除非手動下載啦.
9
手動下載:
下邊TAB Brower Index | 找到JAR | 右邊 |download.
現在,在D:\bisoft\tools\sonatype-work\nexus\storage\central\中快取了JAR包.
10
安裝為服務
64位執行 nexus.bat install 報錯,原因是許可權不啦.
解決辦法:
新建一個nexus-install.bat:
nexus.bat install
然後右鍵|以管理員身份執行(好像管理員必須要密碼才行....)
11
管理組,組是一個很好的東西,它能組合多個倉庫並對映到一個URL上.
Nexus 預設提供一個組:Public Repositories.
Ordered Group Repositories:新加的倉庫,將倉庫加入其中即可.
12
改變nexus監聽埠
$NEXUS_HOME/conf/nexus.properties
application-port=8081
13
配置 Maven
%user.dir%/.m2/settings.xml
Xml程式碼
- <?xmlversion="1.0"encoding="UTF-8"?>
- <settingsxmlns="http://maven.apache.org/SETTINGS/1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd">
- <localRepository>D:\bisoft\tools\maven3\repository</localRepository>
- <pluginGroups>
- <pluginGroup>org.mortbay.jetty</pluginGroup>
- <pluginGroup>org.codehaus.cargo</pluginGroup>
- </pluginGroups>
- <proxies>
- </proxies>
- <servers>
- <server>
- <id>releases</id>
- <username>admin</username>
- <password>admin123</password>
- </server>
- <server>
- <id>snapshots</id>
- <username>admin</username>
- <password>admin123</password>
- </server>
- </servers>
- <mirrors>
- <mirror>
- <id>nexus</id>
- <mirrorOf>*</mirrorOf>
- <url>http://localhost:8081/nexus/content/groups/public</url>
- </mirror>
- </mirrors>
- <profiles>
- <profile>
- <id>nexus</id>
- <repositories>
- <repository>
- <id>central</id>
- <url>http://central</url>
- <releases><enabled>true</enabled></releases>
- <snapshots><enabled>true</enabled></snapshots>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>central</id>
- <url>http://central</url>
- <releases><enabled>true</enabled></releases>
- <snapshots><enabled>true</enabled></snapshots>
- </pluginRepository>
- </pluginRepositories>
- </profile>
- </profiles>
- <activeProfiles>
- <activeProfile>nexus</activeProfile>
- </activeProfiles>
- </settings>
- </settings>
配置部署
pom.xml
Xml程式碼
- <distributionManagement>
- <repository>
- <id>releases</id>
- <name>InternalReleases</name>
- <url>http://localhost:8081/nexus/content/repositories/releases</url>
- </repository>
- <snapshotRepository>
- <id>Snapshots</id>
- <name>InternalSnapshots</name>
- <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
- </snapshotRepository>
- </distributionManagement>
14
上傳第三方包
14.1
mvn deploy:deploy-file -Dgroup -Dartifact
-Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=ojdbc.jar
-Durl=http://localhost:8081/nexus/content/repositories/thirdparty
-Drepository
14.2
直接複製到倉庫
14.3
介面上傳
15.
備份
直接備份 sonatype-work 目錄即可.
轉載於:https://my.oschina.net/91jason/blog/370137