maven下载源码失败,Sources not found for:xxx

想看代码的源码时,发现看不了:

Cannot download sources
 Sources not found for:
 org.apache.commons:commons-pool2:2.4.2

maven下载源码失败,Sources not found for:xxx

这种情况是因为源码的jar包没有下载到本地的仓库。如图:

maven下载源码失败,Sources not found for:xxx

.lastUpdated结尾的文件为源码jar包,此时下载失败。

解决方法:手动下载源码jar包放到本地仓库中。

maven下载源码失败,Sources not found for:xxx

问题解决,这样就可以看源码了。