views:

344

answers:

2

Hi all,

I am using m2eclipse for managing maven projects in eclipse. It seems that in the previous release that I was using (0.9.8) the workspace resolution did not work at all, but right now it also does not work quite as I would expect. Namely, when the "resolve dependencied from workspace" setting for a project is not checked, the project turns red and cannot be build. The message says: artifact xxx x.y-SNAPSHOT cannot be found int local repository (or something to that extent). The trouble is that m2eclipse is putting information about workspace project into my local repo. Is there a way to change this behaviour?

P.S. The workaround for this is to close the xxx project, then m2eclipse resolved the dependency to whatever version I've had previously in the local repository (i.e. the non-snapshot version).

P.S.2 screenshots showing what I have in the local repo:

  • Maven repos in eclipse

alt text

  • filesystem versions of the artifact in question

alt text

  • what is in the snapshot dir:

alt text

A: 

It seems that in the previous release that I was using (0.9.8) the workspace resolution did not work at all, but right now it also does not work quite as I would expect.

That's not what I'm experiencing. I have a project that has a dependency on another project and that is currently using workspace resolution:

alt text

If I uncheck Resolve dependencies from Workspace projects (under Properties > Maven) and apply the change, my build path becomes:

alt text

The dependency is changed into a binary dependency as expected.

Pascal Thivent
perhaps the problem is that I am using version ranges in the POM... I will re-evaluate this.Which version gets used when you launch mvn from the commandline?
Bartosz Radaczyński
@Bartosz The same version as on the capture, 1.0-SNAPSHOT. But indeed, your problem may be due to version ranges. I can't confirm this, I don't use version ranges, they create more problems than they solve IMO (dependency resolution, build reproducibility, etc).
Pascal Thivent
@Pascal no, I meant, is it the version from a (possibly remote) repository or version from the workspace? IMHO the problem is still that m2eclipse puts information about workspace projects into the local maven repo. As to the ranges: everything has its pros and cons. Up till now (and before upgrading m2eclipse) version ranges had more pros.
Bartosz Radaczyński
@Bartosz I'm not sure I'm following you. AFAIK, m2eclipse doesn't put any eclipse related thing in my local repo. Do you have an example illustrating this?
Pascal Thivent
@Pascal: take a look at the screenshots. m2eclipse does this, and only in versions > 0.9.8
Bartosz Radaczyński
A: 

OK, for now the answer for me has been to downgrade to version 0.9.8, in which the plugin does not mess with the local repo.

Bartosz Radaczyński