How to configure / import an MVN project with multiple maven in an Eclipse project in the best way?

I use Eclipse (3.4.2 *), m2eclipse (0.9.8), Subversive (0.7.9), and SVNKit (1.6.10) on a 64-bit Windows 7 PC.

Can someone give some advice on how to set up (import, really) a project with several maven modules in Eclipse, but still fulfill the requirements below?

  • Eclipse should support one project for each add-on module in accordance with general recommendations (if I remember correctly that the disruptive plugin no longer supports nested modules in one project).

  • Eclipse should recognize all java files as proper java classes (that is, they must be found using the Open Type dialog box, as well as all other normal Java functionality in Eclipse, such as displaying a type / call hierarchy).

  • All target folders and .svn files and folders should be excluded when using file search or the "Open Resource" dialog, and all svn folders should be excluded / hidden in the Navigator.

  • An "open resource" should not display a single file more than once.

  • When I open a file using the "Open Resource" or "Open Type" dialog, I should be able to view svn-history for it.

  • I can make an svn switch for the entire maven project (i.e. including all the auxiliary modules) in one step.

Project structure, in simple words:

<main project folder> | | ---- pom.xml | | ---- module 1 | | | | | --- pom.xml | --- src/main/java | ---- module 2 [...] 

The main problem I ran into is requirement 2. Eclipse does not seem to understand that java files are suitable java classes if they do not find them in additional modules. To do this, while padding 4 is still required, I have to exclude a bunch of folders in the main eclipse project when setting up my working set. But then I violate requirement 5, since Eclipse will then open the java file in the submodule project, and this project is not connected to SVN. And if I try to fix this by connecting the submodule project with SVN, I will break requirement 6 (if I do swich in the main project, the submodule projects still think that they are connected to the old branch / trunk).

Any thoughts / suggestions? Changing the basic structure of a project is not an option. I tried to find the previous discussions on this topic, but they all seem to cover only part of the problem (for example, β€œhow to hide svn files / folders in eclipse?” Or β€œOpen Type does not find some classes”) and none of them cover The whole range of the eclipse + SVN + maven project with additional modules.

* The reason I'm still using this version is because for the Eclipse platform itself, as far as I know (no version 3.4.x), there is no simple, updated update function, and I hate to perform a new installation, and then manually configure everything the way I want and install all the plugins.

+4
source share
1 answer

I think that if you do the following, you will get everything you want.

  • The repository examines the verification of the parent project. IE containing modules.
  • After checking, the project will not look right, so delete it. DO NOT delete sources.
  • Then go to file> import and import the parent folder of the project.

Then you should see the parent and modules as separate projects, and most (if not all) of the requirements that you specified should be met.

+3
source

All Articles