views:

904

answers:

4

I am trying to setup a multi module SpringMVC appfuse applicaiton in Eclipse but it seems that I'm facing lots of errors in Eclipse after I import the project in Eclipse. Can anyone please help me with a step by step guideline showing the ideal way to setup such application in Eclipse?

A: 

What are the errors? The most common problem I can think of is library errors, in which case you have to edit the build path.

bpapa
A: 

From what I recall for multi-module projects, eclipse just does not handle this well. It would help to see the specific errors you're getting, and then to start from there.

Spencer K
+2  A: 

Have you tried using maven eclipse plugin? You can just go to the project root folder (the one that contains your pom.xml file) and run "mvn eclipse:eclipse" from the command line.

This will build project files for each of your modules and also create inter-dependencies. You can just treat your multi-module project like a workspace with multiple projects.

Most of the errors that appear at load time, after mvn eclipse:eclipse are because of the repository variable. You can configure this by using "mvn -Declipse.workspace= eclipse:add-maven-repo".

More info on maven eclipse plugin at http://maven.apache.org/plugins/maven-eclipse-plugin/.

Regards, Bogdan

Bogdan
A: 

I know this problem, it's not related to Appfuse but rather to Maven itself. I suggest to follow these steps:

  • set up your project;
  • create every directory/source needed: mainly java sources and resources files, for both application AND unit tests;
  • make sure everything compiles and all tests pass. for this you can check with

    mvn package

  • use the eclipse maven plugin:

    mvn eclipse:eclipse

This way the project will include everything that's needed in the classpath: Spring and Log4j configuration files, resources, etc.

If you already executed the mvn eclipse:eclipse command, just delete the project from Eclipse (DON'T DELETE FILES!), remove Eclipse-specific files from directory, re-run mvn eclipse:eclipse

My 2 cents

Megadix
You can say mvn eclipse:clean to get rid of .classpath, .project, etc.
Dominic Mitchell