For my installation, I have profiles defined in mine ~/.m2/settings.xml, where profiles define some project-specific repositories. From the command line, I can successfully create projects using -PprofileHere. However, the profile does not turn on automatically (i.e. is activeByDefaultnot set to truefor the profile).
In Eclipse 4.5.1 (Mars 1) with m2e 1.6.2.20150902-0002, I import projects using Import→ Maven→ Existing Maven Projects. I select the parent project, and Eclipse imports them. Projects for children are imported, but, as expected, their dependencies are incorrectly resolved. To try to fix this, I select the parent project, right-click Maven→ Select Maven Profiles...and select the correct profile for the parent. Then I do tango m2e, trying to do the following combinations:
- Cleaning and restoring a project (
Project→ Clean...) - Updating the parent project (right click,
Maven→ Update Project...) - Updating subsidiary projects (less)
- Restart Eclipse
Eclipse continuously displays dependencies that are not resolved in child projects when viewing children pom.xmlor opening a class in a child module with unresolved dependencies. The only workaround I found was to automatically enable the profile in mine ~/.m2/settings.xml. Then and only then does Eclipse correctly resolve Maven dependencies.
What am I doing wrong when initially importing / setting up projects in Eclipse?
source
share