在 Eclipse 中从 SVN 检出 Maven 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11916776/
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
Checking out Maven project from SVN in Eclipse
提问by Harvey
I have just downloaded and installed the latest Eclipse Juno. I have also installed Maven and SVN through the Eclipse Market Place. The problem I am getting is that when I check-out a project from my SVN repository, the project doesn't get checked out as a Maven project.
我刚刚下载并安装了最新的 Eclipse Juno。我还通过 Eclipse Market Place 安装了 Maven 和 SVN。我遇到的问题是,当我从 SVN 存储库检出项目时,该项目不会作为 Maven 项目检出。
I am using Windows 7 x64 OS. Could anyone shed some light on this matter? Am I doing something wrong?
我正在使用 Windows 7 x64 操作系统。任何人都可以对这个问题有所了解吗?难道我做错了什么?
回答by Nicholas Albion
With m2e installed, you can right click on the project and:
安装 m2e 后,您可以右键单击该项目,然后:
- "Configure"->"Convert to maven project" (and it will read your pom.xml) or
- "Maven"->"Disable maven nature"
- “配置”->“转换为 Maven 项目”(它会读取您的 pom.xml)或
- “Maven”->“禁用Maven特性”
I often use both steps (in reverse order) to "reboot" the maven configuration.
我经常使用这两个步骤(以相反的顺序)来“重启”maven 配置。
回答by Tomer
The project doesn't need to be checked out as a maven project. What you need to do is, after checking out your project ( using the SVN perspective ) go to the Java perspective and import it as a maven project.
该项目不需要作为 maven 项目检出。您需要做的是,在检出您的项目(使用 SVN 透视图)后,转到 Java 透视图并将其作为 maven 项目导入。
This will work if your project has a pom.xml file.
如果您的项目有 pom.xml 文件,这将起作用。
回答by Teh Hippo
You can install a plugin called m2e-subclipse to do that, but it's not currently that support. You might need to build it yourself.
您可以安装一个名为 m2e-subclipse 的插件来执行此操作,但目前尚不支持。您可能需要自己构建它。
Alternatively, what I prefer to do, is check out the project using TortoiseSVN (or a similar client for mac/linux). Subclipse will still pick up that it is a SVN project, and I'll use m2e to import the project (Import existing Maven project).
或者,我更喜欢做的是使用 TortoiseSVN(或类似的 mac/linux 客户端)检查项目。Subclipse 仍然会发现它是一个 SVN 项目,我将使用 m2e 导入该项目(导入现有的 Maven 项目)。
回答by Raj kannan Iyyappan
- Go to SVN repository Exploring perspective and checkout the project.
- Then go to Java perspective, right click the project and select Configure->Convert to Maven project
- 转到 SVN 存储库探索透视图并签出项目。
- 然后转到Java透视图,右键单击项目并选择Configure->Convert to Maven project
This works for me in Eclipse Luna.
这在 Eclipse Luna 中对我有用。