简体   繁体   English

mvn eclipse:eclipse无法正常工作

[英]mvn eclipse:eclipse not working

After importing mavenised project from SVN, I can run mvn clean mvn install command successfully. 从SVN导入mavenised项目后,我可以成功运行mvn clean mvn install命令。 But, getting error while running mvn eclipse:eclispe command to generate .project and .classpath files automatically which are required to make this project as a eclipse specific project. 但是,在运行mvn eclipse:eclispe出现错误mvn eclipse:eclispe命令会自动生成.project和.classpath文件,这些文件需要将此项目作为eclipse特定项目。

Error message after runnning mvn eclipse:eclipse 运行mvn eclipse后的错误信息:eclipse

k\Projects\code-base\PNEBatch>mvn eclipse:eclipse
 Scanning for projects...
 Searching repository for plugin with prefix: 'eclipse'.
 ------------------------------------------------------------------------
] BUILD ERROR
 ------------------------------------------------------------------------
 The plugin 'org.apache.maven.plugins:maven-eclipse-plugin' does not exist
 valid version could be found
 ------------------------------------------------------------------------
 For more information, run Maven with the -e switch
 ------------------------------------------------------------------------
 Total time: < 1 second
 Finished at: Tue May 06 18:16:20 IST 2014
 Final Memory: 4M/121M

After this i also tried to including mvn-eclipse plugin in project pom.xml file as 在此之后我还尝试在项目pom.xml文件中包含mvn-eclipse插件

<plugin>
<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-eclipse-plugin</artifactId>
</plugin>

but still it is not able to locate that plugin. 但仍然无法找到该插件。 I have also tried running command mvn -npr eclipse:eclipse but no luck. 我也试过运行命令mvn -npr eclipse:eclipse但没有运气。

Can somebody suggest me what else should I do or is there any other way we can setup classpath after importing from SVN if mvn eclipse:eclipse is not working? 有人可以建议我还应该做什么,或者是否有任何其他方式我们可以在从SVN导入后设置类路径如果mvn eclipse:eclipse不起作用?

The mvn eclipse:eclipse generates project and classpaths, yes. mvn eclipse:eclipse生成项目和类路径,是的。 However, that was before there was a suitable eclipse plugin for the task. 然而,那是在为任务提供合适的eclipse插件之前。

If your workspace includes m2e, you can simply use file->import->existing maven project to open it inside eclipse. 如果您的工作区包含m2e,您只需使用file-> import->现有的maven项目在eclipse中打开它。 But, if you already have created project files from mvn eclipse:eclipse it tends to not work properly. 但是,如果你已经从mvn eclipse:eclipse创建了项目文件,它往往无法正常工作。 In that case try deleting all eclipse files ( .classpath, .settings, .project ) before importing it. 在这种情况下,尝试在导入之前删除所有eclipse文件( .classpath,.settings,.project )。

If you really want to use mvn eclipse:eclipse on the commandline and it fails with version, you may have somethings in your setting that prevents it from reaching maven central (a local company proxy or similar). 如果你真的想在命令行上使用mvn eclipse:eclipse并且它随版本失败,那么你的设置中可能会有一些东西阻止它到达maven central(本地公司代理或类似)。 Try using mvn help:effective-settings or mvn help:effective-pom if you need to see them. 尝试使用mvn help:effective-settingsmvn help:effective-pom如果你需要看到它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM