从SVN导入mavenised项目之后,我可以成功地运行mvn clean mvn install命令。但是,在运行mvn eclipse:eclispe命令自动生成.project和.classpath文件时出错,这是使该项目成为eclipse特定项目所必需的。
运行mvn后的错误消息: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之后,我还尝试将mvn-eclipse插件包含在项目pom.xml文件中,如
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
</plugin>但是它仍然无法找到那个插件。我也尝试过运行命令mvn -npr eclipse:eclipse,但没有成功。
有人能建议我应该做些什么吗?或者,如果mvn eclipse:eclipse不能工作,那么在从SVN导入之后,我们还有其他方法可以设置类路径吗?
发布于 2014-05-07 09:29:01
mvn eclipse:eclipse生成项目和类路径,是的。然而,这是在还没有一个合适的eclipse插件的任务。
如果您的工作区包含m2e,您可以使用文件->import->现有的maven项目在eclipse中打开它。但是,如果您已经从mvn eclipse:eclipse创建了项目文件,那么它往往无法正常工作。在这种情况下,试着在导入所有eclipse文件(.classpath、.settings、.project)之前删除它。
如果您真的想在命令行上使用mvn :eclipse,并且它在版本中失败了,那么您的设置中可能有一些东西阻止它到达maven central (本地公司代理或类似的)。如果您需要看到它们,请尝试使用mvn help:effective-settings或mvn help:effective-pom。
https://stackoverflow.com/questions/23512174
复制相似问题