You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by klimane <El...@fcc-fac.ca> on 2009/02/06 23:51:35 UTC

Aggregator pom fails, but modules work

I have the following project structure:

ProjectA
    pom.xml [aggregator of the other two]
    src
        pom.xml
    test
        pom.xml

When I run the test build by itself either from the test directory or by
modifying the aggregator pom to exclude the src module and only include the
test module, it works.  However, when I run a build on the aggregator pom
(with the aggregator pom including both src and test modules), the test
module fails at compilation, stating that it can't find a class that is part
of the src build.  The test/pom.xml has the src artifact as a dependency. 
Also, I have this pattern working in other projects.  I'm just wondering if
anyone has any suggestions or if anyone has seen this type of behaviour
before.
-- 
View this message in context: http://www.nabble.com/Aggregator-pom-fails%2C-but-modules-work-tp21882332p21882332.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Aggregator pom fails, but modules work

Posted by klimane <El...@fcc-fac.ca>.
We've gotten a bit further with this, however, we are still finding that we
are having some problems when using aggregator poms.

The original situation has been fixed after discovering a problem with how
the source directory was in one of the parent pom files.

Now we've found that if we have a master aggregator pom that has ProjectA,
ProjectB, and ProjectC in it, where the tests in ProjectB depend on the
tests in ProjectA, the test directory from ProjectA doesn't get added to the
classpath, but rather, the source directory gets added twice.

We also noticed that when using the aggregator, the classpath elements refer
to the source code directories, and not to the local repository for any
dependencies that were also being built as part of the aggregator.  If there
was a way to change this so that the aggregator always looked at the local
repository, regardless of what else is being built at the same time, this
would fix our problem - if we build ProjectA separately and do not include
it in the aggregator, the aggregator builds fine, as it refers to the jars
in the local repository, and it adds both the source and test jars to the
classpath, as it should.

Can someone help us here with either how to get the aggregator pom to refer
to the local repostory rather than to the source directory, or with how to
get the aggregator pom to properly refer to the test directory?


-- 
View this message in context: http://www.nabble.com/Aggregator-pom-fails%2C-but-modules-work-tp21882332p22163774.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Aggregator pom fails, but modules work

Posted by Merv Green <Pa...@gmail.com>.
Apologies if I was a bit brusque. Though I can't think of any reason 
why, I was speculating that it might involve something insidious about 
how the compiler or surefire expects the project structure. Different 
directory names help isolate the problem.

Anyhow, you might have an old version of the artifact under test in your 
local repo.

klimane wrote:
> I'm not quite sure what you mean by "abusing 'src' and 'test'".  


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


Re: Aggregator pom fails, but modules work

Posted by klimane <El...@fcc-fac.ca>.
I'm not quite sure what you mean by "abusing 'src' and 'test'".  At any rate,
yes, I get the same problem if I rename the sub-projects dir1 and dir2. 
Also, I had a look at the shitty-maven-plugin, and it looks like it will
require a directory re-structure, since it expects the tests to be under
src/it.  Unfortunately we must make Maven work without modifying our
directory structure, so that won't be an option for us unless that bit can
be configured.

Any other ideas/suggestions?


Merv Green wrote:
> 
> You may be abusing 'src' and 'test.' Do you get the same problem if you 
> rename the sub-projects 'dir1' and 'dir2?' Have you considered something 
> like the shitty-maven-plugin? Google for 'maven integration testing.'
> 

-- 
View this message in context: http://www.nabble.com/Aggregator-pom-fails%2C-but-modules-work-tp21882332p21938575.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Aggregator pom fails, but modules work

Posted by Merv Green <Pa...@gmail.com>.
You may be abusing 'src' and 'test.' Do you get the same problem if you 
rename the sub-projects 'dir1' and 'dir2?' Have you considered something 
like the shitty-maven-plugin? Google for 'maven integration testing.'

klimane wrote:
> I have the following project structure:
>
> ProjectA
>     pom.xml [aggregator of the other two]
>     src
>         pom.xml
>     test
>         pom.xml
>
> When I run the test build by itself either from the test directory or by
> modifying the aggregator pom to exclude the src module and only include the
> test module, it works.  However, when I run a build on the aggregator pom
> (with the aggregator pom including both src and test modules), the test
> module fails at compilation, stating that it can't find a class that is part
> of the src build.  The test/pom.xml has the src artifact as a dependency. 
> Also, I have this pattern working in other projects.  I'm just wondering if
> anyone has any suggestions or if anyone has seen this type of behaviour
> before.
>   


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