开发者

Integrating a maven project into Eclipse

开发者 https://www.devze.com 2023-03-23 19:35 出处:网络
I have a maven module for validation which I must pass to a 开发者_Go百科old version of Eclipse which has the Jrules API within. However there is not a maven plugin for this eclipse IDE. So I figured

I have a maven module for validation which I must pass to a 开发者_Go百科old version of Eclipse which has the Jrules API within. However there is not a maven plugin for this eclipse IDE. So I figured I would do a maven:install on the module and move over the created jar. However when I try to import->Existing Projects into Workspace->Select archive file: and point it to the jar no projects appear. I'm at a loss as to how I can move my maven module to the outdated eclipse, without having to grab the 101 jars required for the project and non mavenise it... Surely their has to be an easy way to this or is maven will monolithic


Use the maven-eclipse-plugin to generate the .project and .classpath files for you:

mvn eclipse:eclipse

This will create the IDE metadata files which reference all of the JARs your project depends on from within your local maven repository folder.

Attempting to import the JAR that is built by the Maven build process into Eclipse using the " import->Existing Projects into Workspace->Select archive file" doesn't work because Eclipse expects to find a .zip/.jar file with the .project metadata files and the source code. Your compiled JAR likely contains neither.


I would recommend using the M2Eclipse maven plugin. Right click the project -> Enable Dependency Management -> Update Project Configuration

I have used eclipse:eclipse extensively and my experience is that M2Eclipse is not only better supported but works better overall.

0

精彩评论

暂无评论...
验证码 换一张
取 消