参考: IDEA maven本地仓库、中心仓库、远程仓库配置
在观看第三方jar包的api时,有时候需要下载源码看下注释。
这个时候用idea 上的提示的Download Source
会发现一直下载不下来。
因此就怀疑用的是apache的maven仓库,不是我们用的 aliyun 镜像仓库。
下面是我加好后的,然后点download Source发现一下子就好了
<profiles>
加入
<profile>
<id>dev</id>
<repositories>
<repository>
<id>aliyun-releases</id>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
平级下加入,启用这个profile
<activeProfiles>
<activeProfile>dev</activeProfile>
</activeProfiles>
如果没有生效的话重启IDEA