简体   繁体   中英

Integrating a maven project into Eclipse

I have a maven module for validation which I must pass to a 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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