MyEclipse: Frustrations with Maven and Importing....
PredatorVI - Jun 02, 2012 - 05:01 AM
Post subject: Frustrations with Maven and Importing....
I've been converting our [many] projects to Maven and am having some frustration with how MyEclipse appears to be handling Maven projects.
MyEclipse 10.1 (x64)
MS TFS Plugin 10.0.1
Here are my issues:
Using TFS plugin, a direct import from the Source Control view doesn't enable Maven features. No amount of "Refresh"ing seems to work. The only thing that works is to close and delete the project (not the source), reimport as Import-->Maven4MyEclipse-->Existing Maven Projects, then [project]-->[Right Click]Team-->Share Project... and enable TFS again.
That is too much hassle for the dozens of projects we have. Am I missing something?
In my newly imported projects, whatever normal build process MyEclipse does is not running all the Maven Goals. I have some projects that use web service clients that are generated during the build. I haven't been able to find out how to change the behavior and I don't know why it just doesn't do the basic 'mvn install' during a rebuild every time by default?!
Is there a way to change this behavior that I'm missing?
Newly imported projects don't seem to keep in sync with the local maven repository or repository indexes. Even though I can build on the command line and Maven is pulling dependencies into the local repo, MyEclipse doesn't seem to recognize this, even if I do a "Run As-> Maven clean" then "Run As->Maven install from within MyEclipse itself. The only thing that seems to work (and only sometimes) is to restart MyEclipse after the project has been successfully built. This is very frustrating.
I have unchecked the option in the Preferences that prevents MyEclipse from updating from external repositories. I've refreshed and reloaded project configs and dependencies (with the "Force..." option enabled).
What am I missing something?
support-tony - Jun 04, 2012 - 08:16 AM
I'm sorry you're hitting these issues with our maven integration.
- Our maven integration is based on the eclipse maven project, m2e. In order to import maven projects from a software configuration management system, an SCM connector for m2e is needed that matches the SCM plug-in used in the IDE. Unfortunately, I'm not aware of such a connector for TFS. If you go to import a maven project from SCM, one of the wizard pages (in MyEclipse 10.1 or above) has a link to an eclipse marketplace dialog that shows various m2e connectors and allows the user to install them - the SCM connectors are at the bottom. To date, there are connectors for Egit, cvs, subclipse and subversion plug-ins.
I've searched for enhancement requests on the eclipse bugs site but can't see any requests for the TFS plug-in to be supported so you might be the first developer trying to do this and you may want to add such a request yourself.
If the projects in TFS are maven eclipse projects (i.e. have the org.eclipse.m2e.core.maven2Nature specified in the natures element) then you might try checking out the project outside of MyEclipse, to the file system, and then importing it as a normal eclipse project (i.e. don't import as an existing maven project, but as an existing eclipse project - Import->General->Existing Projects into Workspace).
- The eclipse build process doesn't invoke maven builds (the Maven Project Builder, in the project's builder list just ensures eclipse metadata is updated properly). Maven builds are only done via the Run As menu.
You can add your own builder to the list of builders. Right click on the project, select Properties. Now go to General->Builders and select New. You can add a program entry that runs the mvn command, with the working directory as the project and an argument of the goal you want to build to. This should run only on full builds (not incremental builds). It's a project specific setting, which may not be what you'd like but worth pursuing.
- This sounds like it may be a bug but can you provide more information? The project dependencies are picked up from the pom, and so should be finding them in the local repository. Is it a certain type of dependency that is causing the problem? The Run As option runs maven, using the built-in runtime (you can change this in the preferences) so it should act just like running mvn outside of eclipse at that point (though there may be some difference in the way user settings are picked up - I'm not sure about that, at the moment).
All times are GMT - 6 Hours
Powered by PNphpBB2
© 2003-2004 The PNphpBB GroupCredits