Archive

Posts Tagged ‘m2eclipse’

m2eclipse workspace resolution not working ?

janvier 19, 2010 1 commentaire

We have this « fix »:

  • Go to your workspace folder
  • in the folder .metadata/.plugins/org.maven.ide.eclipse, remove all file ending with .container
  • in eclipse, clear all projects
  • hope for the best

For us, it has resolved a nasty issue we had : some projects’ dependencies weren’t resolved locally even if the projects in question were in the workspace.

Hope it helps

++

Étiquettes : , , ,

How we have the development specific code safely out of the way

septembre 12, 2009 2 commentaires

Quite frequently, one has to write some development specific code. For example, at work, we have, when needed, an « application launcher » (named with the application name) and a dev web page, mounted under /dev. This page in turn allows to write shortcuts in the application work flow, in order to access specific page with an ad hoc environment (profile, data…).

However, one quickly wonders how to be sure these classes won’t get in production.

Our solution is linked to m2eclipse. This maven plugin for eclipse has the following behavior : it puts both the main and test source paths in the class path. As such, one can access both the production and test code when running the application from eclipse. This is normally not done by Maven. More precisely, Maven build jars don’t include the test code.

The solution is then really easy : we put our dev. specific code under the test branch, and we are perfectly able to run it all from eclipse. But Maven makes sure none of it will make it into the production jar/code. Double with this application launcher + dev page conventions, it really makes it simple to dig into an application/project. Nice and easy no ?

Étiquettes : , , ,

m2eclipse tips

août 18, 2009 2 commentaires

Thanks to Maven: The Definitive Guide, I was able to answer some questions I had about m2eclipse as well as learn more of it.

  • When you put a plugin in the build part of the pom, how comes some are running on each source modification and others not ?
    The reason is simple : m2eclipse runs by default the plugins in the process-resources phase. Furthermore, this is set up in the Preferences/Maven part of eclipse (but the settings affects all projects, which was a bit overkill for us)?

  • One can ask m2eclipse to display the projects’ maven version, through Preferences/General/Appearance/Label Decorations and then check « Maven Version Decorator ». Comes handy when having to update different versions of different plugins.

  • Last but not least, the pom editor « Dependency hierarchy » tab is in fact pretty useful :$
    Before I was looking at the « Maven Dependencies » folder to figure out what was there, but in fact this tab displays it nicely.
    Two lists are shown there : « Dependency Hierarchy » and « Resolved dependencies ». The first one allows to figure out what was rejected (and from where in the dependencies), the second one shows what is in.
    A search is available and run on both lists. So if you wonder about spring dependencies issues, just put spring in the search field, and you all artifact ids containing spring are highlighted.

Hope it helps !
++

Étiquettes : , ,
%d blogueurs aiment cette page :