m2eclipse 不会从本地存储库下载源代码
我在 Eclipse 中使用 Maven 来管理从本地存储库 (SNAPSHOT) 解析的项目依赖项。它可以很好地进行编译,但是当我尝试下载包的源代码(通过右键单击包和 Maven -> 下载源)时,它不起作用。
我得到的只是这个输出,但没有任何信息说明为什么插件不尝试下载源代码:
27.08.09 11:42:24 MESZ: [INFO] User settings file does not exist /home/my-name/.m2/settings.xml
27.08.09 11:42:24 MESZ: [DEBUG] Reading global settings from: /opt/shared/apache-maven/conf/settings.xml
27.08.09 11:42:24 MESZ: [DEBUG] Reading user settings from: null
27.08.09 11:42:24 MESZ: [DEBUG] Settings file is null. Returning null.
存储库中的文件如下所示:
Collection: /com/my-company/product/0.0.2-SNAPSHOT
# product-0.0.2-20090827.071202-1-sources.jar
# product-0.0.2-20090827.071202-1-sources.jar.md5
# product-0.0.2-20090827.071202-1-sources.jar.sha1
# product-0.0.2-20090827.071202-1.jar
# product-0.0.2-20090827.071202-1.jar.md5
# product-0.0.2-20090827.071202-1.jar.sha1
# product-0.0.2-20090827.071202-1.pom
# product-0.0.2-20090827.071202-1.pom.md5
# product-0.0.2-20090827.071202-1.pom.sha1
# maven-metadata.xml
# maven-metadata.xml.md5
# maven-metadata.xml.sha1
有人对源代码下载不起作用的原因有任何建议吗?
I am using Maven in Eclipse to manage the project dependencies which are resolved from a local repository (SNAPSHOT). It works fine for compiling, but when I am trying to download the sources of a package (via right-click on package and Maven -> Download Sources) it does not work.
All I am getting is this output, but no information why the plugin is not trying to download the sources:
27.08.09 11:42:24 MESZ: [INFO] User settings file does not exist /home/my-name/.m2/settings.xml
27.08.09 11:42:24 MESZ: [DEBUG] Reading global settings from: /opt/shared/apache-maven/conf/settings.xml
27.08.09 11:42:24 MESZ: [DEBUG] Reading user settings from: null
27.08.09 11:42:24 MESZ: [DEBUG] Settings file is null. Returning null.
The files at the repository look like this:
Collection: /com/my-company/product/0.0.2-SNAPSHOT
# product-0.0.2-20090827.071202-1-sources.jar
# product-0.0.2-20090827.071202-1-sources.jar.md5
# product-0.0.2-20090827.071202-1-sources.jar.sha1
# product-0.0.2-20090827.071202-1.jar
# product-0.0.2-20090827.071202-1.jar.md5
# product-0.0.2-20090827.071202-1.jar.sha1
# product-0.0.2-20090827.071202-1.pom
# product-0.0.2-20090827.071202-1.pom.md5
# product-0.0.2-20090827.071202-1.pom.sha1
# maven-metadata.xml
# maven-metadata.xml.md5
# maven-metadata.xml.sha1
Does anybody have any suggestions why the source download is not working?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的maven安装驻留在版本文件夹中(例如/opt/shared/apache-maven-2.2.1),并且共享文件夹链接到该文件夹(例如/opt/shared/apache-maven)。可能是 Eclipse 或 m2eclipse 的符号链接有问题...
因为在我做了以下事情后问题就消失了:
我不知道到底发生了什么,但这神奇地解决了我的问题。
My maven-installation resides in a version folder (e.g. /opt/shared/apache-maven-2.2.1) and a shared folder is linked to that folder (e.g. /opt/shared/apache-maven). It might be that Eclipse or m2eclipse has problems with symbolic links ...
Because the problem went away after I did the following things:
I don't know what happened exactly, but this solved my problems magically.
尝试在 m2Eclipse 问题 中搜索,有几个“下载源”问题
也许这就是您描述的问题
try searching in the m2Eclipse Issues there are a couple of "Download Sources" Issues
Maybe this is the Problem you described
就我而言,可能也是OP的情况,错误/丢失的
settings.xml
文件很重要。如果您的存储库不可用(我的指定存储库由于某些安全相关原因而无法访问),Eclipse 将使用默认值。我从命令行指定了一个--settings
值,但 Eclipse 没有得到此帮助。一旦我正确编译了所有内容(不要忽略 Eclipse maven 构建错误),它就能够下载我的 Spring 源代码。希望我现在能做一些工作。
In my case, and possibly the OP's too, the bad/missing
settings.xml
file is important. Eclipse will use a default if yours isn't usable (mine specified repos that are inaccessible for some security related reason). From the command line I'd been specifying a--settings
value and Eclipse wasn't getting this assistance.Once I got everything to compile correctly (don't ignore the Eclipse maven build errors) then it was able to download my Spring sources. Hopefully I can do some work now.