记一次 Nexus 私服 301 问题
最近在学习 Nexus 私服得搭建,在本地 Nexus 成功运行后,项目无论是 clean、install、deploy 都是 401 问题。
这里给大家记录一次相关配置
-
首先是 账号问题,请确认用户名、密码、权限是否正确
-
再次确认账号问题。如果账号没有确认 允许匿名用户访问服务器,那么这是一个大坑。楼主这里2天,找了好多博客,就是这里没有勾上。
-
setting.xml 与 项目 pom.xml 得id 要一一对应。
<servers> <server> <id>nexus-releases</id> <username>admin</username> <password>123456</password> </server> <server> <id>nexus-snapshots</id> <username>admin</username> <password>123456</password> </server> </servers>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus release repository</name>
<url>http://localhost:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus snapshot repository</name>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
- 另外在看 idea 报得问题是否只有一个401,可能有其他 setting.xml 文件语法问题没有仔细看
另外,博客不一定是正确得,要学会自己去找问题