For my setup, I have profiles defined in my ~/.m2/settings.xml
, where the profiles define some project-specific repositories. From the command line, I can successfully build the projects using -PprofileHere
. However, the profile isn't enabled automatically (i.e. activeByDefault
is not set to true
for the profile).
In Eclipse 4.5.1 (Mars 1) with m2e 1.6.2.20150902-0002, I import the projects using Import
→ Maven
→ Existing Maven Projects
. I select the parent project and Eclipse imports them. The children projects are imported, but as expected, their dependencies aren't correctly resolved. To attempt to fix this, I select the parent project, right-click Maven
→ Select Maven Profiles...
and select the correct profile for the parent. I then do the m2e tango by trying various combinations of the following:
- Cleaning and rebuilding the project (
Project
→Clean...
) - Updating the parent project (Right-click,
Maven
→Update Project...
) - Updating the children projects (ditto)
- Restarting Eclipse
Eclipse continuously shows the dependencies unresolved on the children projects when viewing the children pom.xml
's or opening a class in a child module with unresolved dependencies. The only workaround I've found is by enabling the profile automatically in my ~/.m2/settings.xml
. Then and only then does Eclipse properly resolve the Maven dependencies.
What am I doing wrong when originally importing / configuring projects in Eclipse?