You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Kenney Westerhof <ke...@apache.org> on 2007/03/02 12:34:53 UTC

Booty fail

Hi,

I can't bootstrap.

Maven-project doesn't build for me due to test errors.
Other people seem to be building just fine.

I've tracked the problem down to environment issues - the order
in which the tests are run is important.

The errors are in t02.ProjectInheritanceTest and others, depending on
the order.

The issue is that the unit tests test for InceptionYear inheritance, which
is present in the parent poms. When I run the tests one by one, they succeed.

The order i'm getting is t03, t01, t02, t00 where t02 and t00 fail.
T03 contains maven:p4:1.0 (and p3) which do NOT have the inceptionYear
field set, so when building p5 in t02, I'm getting the p4 etc. from t01,
not from t02, which results in a different inherited pom.

The problem is that the MavenProjectBuilder is a singleton, and serves cached
versions of MavenProject/model instances if the group/artifactId matches.

I'm not sure if this is desired behaviour. I see a few alternatives to solve this:

1) fix the caching system to include a check for the pom file, next to the project id.
   I'm not sure about the intent of the caching system - wheter it's just a speedup,
   or to ensure the same pom is used in a reactor, even if it comes from different
   places. IMHO the current approach could produce problems with profiles, unless the original
   model is used (pre-interpolated, pre-inherited). Not sure if that's the case.

2) somehow destroy the projectbuilder after each test/each embedder call. This makes
   sure it's clean, no caches are present. Note that I also said embedder call. I'm sure
   that m2eclipse etc. are having problems when you change a pom - it'll get the original
   model back, unless it destroys the embedder/plexus.

3) quick fix for the booty: change the groupId's or versions in the poms.

For now I'll do 3 as the current unit tests in mavenproject aren't reproducible
on all systems (mainly depending on filesystem ordering I think, or possibly
JRE HashSet implementations if they're used).

-- Kenney


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org