eclipse 我在哪里可以获得 maven-source-plugin?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6820849/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where can I obtain the maven-source-plugin?
提问by Thomas Owens
I checked out an open-source project from SourceForge's SVN source control using the Eclipse Maven plugin. After it checks out, I get this error in the pom.xml file:
我使用 Eclipse Maven 插件从 SourceForge 的 SVN 源代码管理中查看了一个开源项目。检出后,我在 pom.xml 文件中收到此错误:
Error resolving version for plugin 'org.apache.maven.plugins:maven-source-plugin' from the repositories [local (C:\Documents and Settings\thomas.owens\.m2\repository), central (http://repo1.maven.org/maven2)]: Plugin not found in any plugin repository
从存储库 [local (C:\Documents and Settings\thomas.owens\.m2\repository), central (http://repo1 .maven.org/maven2)]:在任何插件库中都找不到插件
I'm fairly new to Maven, but I followed the installation instructions for Apache Maven and the Eclipse plugin. It seems weird that this plugin would not be found in the central plugin repository for Maven or my local repository, when I can clearly see a directory located at C:\Documents and Settings\thomas.owens\.m2\repository\org\apache\maven\plugins\maven-source-plugin
that contains a single resolver-status.properties
file.
我对 Maven 相当陌生,但我遵循了 Apache Maven 和 Eclipse 插件的安装说明。这个插件在 Maven 的中央插件存储库或我的本地存储库中找不到,这似乎很奇怪,因为我可以清楚地看到C:\Documents and Settings\thomas.owens\.m2\repository\org\apache\maven\plugins\maven-source-plugin
包含单个resolver-status.properties
文件的目录。
Any thoughts as to why this plugin might not be found and where I can find it?
关于为什么找不到这个插件以及在哪里可以找到它的任何想法?
回答by Thomas Owens
The problem that I was encountering was not an issue with the maven-source-plugin, but incorrect proxy settings that was preventing the connection to the repositories. The answers to this question on the use of Maven with a proxyhelped me to find the mistake and correct it.
我遇到的问题不是 maven-source-plugin 的问题,而是阻止连接到存储库的不正确的代理设置。关于使用 Maven 和代理的这个问题的答案帮助我找到了错误并纠正了它。
回答by Roy Truelove
That plugin in in the central repo (see here).
中央仓库中的那个插件(见这里)。
Perhaps you just need to run with -U to update:
也许你只需要运行 -U 来更新:
mvn -U clean install
Or in Eclipse right-click on the project and select Maven -> Update Dependencies and (perhaps) Maven -> Update Project Configuration
或者在 Eclipse 中右键单击项目并选择 Maven -> 更新依赖项和(也许)Maven -> 更新项目配置
回答by wleao
Check if you are able to see Maven in Eclipse, Window > Preferences.
检查您是否能够在 Eclipse 中看到 Maven,窗口 > 首选项。
If so, select Maven and go to installations and check if the folder, in where maven was installed, is properly set. Then, set your setting.xml file, it should be in /(maven installation folder)/conf/
如果是这样,请选择 Maven 并转到安装并检查安装 Maven 的文件夹是否正确设置。然后,设置你的setting.xml文件,它应该在/(maven安装文件夹)/conf/
Then, right click in your project go to Maven > Update Maven Dependencies.
然后,右键单击您的项目转到 Maven > 更新 Maven 依赖项。
Did it help?
有帮助吗?
回答by crowne
Which project?
Perhaps there is a bug in their pom.
Or perhaps they require a 'standardized' develop environment with specific environment variables set, or a specific setting in user.home/.m2/settings.xml
哪个项目?
也许他们的 pom 中有一个错误。
或者他们可能需要一个带有特定环境变量集的“标准化”开发环境,或者 user.home/.m2/settings.xml 中的特定设置