1.公司有私有服的时候,这个时候只有两种方式是导入依赖
一种是在setting文件中配置私有仓库
一种是在pom文件中配置私有仓库
如果你在setting文件中配置了阿里的私有服,然后在pom文件中配置了公司的私有仓库,这个时候maven引入依赖优先从setting文件中配置的私有仓库中导入所需的依赖,而不会从你在pom文件中设置的私有仓库,只有从在setting文件中删除掉自己设置的私有仓库,maven才会从pom中设置的私有仓库中下载依赖.
例如:
<!--配置maven阿里云仓库开始,不用去改maven的setting -->
<repositories>
<repository>
<id>public</id>
<name>local private nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>local private nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
2:
错误:
Idea中maven的依赖下面有红色波浪线,IDEA没有错误原因提示.
原因:
可能是包没有下全,因为去maven中查找可以查找到.(下次出现这种问题,可以断网验证一下是不是这个问题)
解决方法:
删除pom文件中的依赖,然后再添加进去,然后重新导入依赖.