maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Maven cyclic dependency when compling tests only - how to resolve easily?
Date Sat, 09 Jun 2012 08:08:56 GMT
No, you create a separate module that just holds the tests. Due to the
different dependencies for these tests I assume they are not unit
tests but rather some sort of integration tests. Having a separate
module for ITs is very common. I'd even go as far as saying it's best
practice.

/Anders

On Sat, Jun 9, 2012 at 7:31 AM, Ken E <ken.egervari@gmail.com> wrote:
> That might work.
>
> Where do I put the second pom.xml for the tests then?
>
> The directory structure is like this:
>
> /main-project/pom.xml (contains all modules: moduleA -> moduleX)
> /main-project/moduleA/pom.xml
> /main-project/moduleA/src
> /main-project/moduleA/test/src
> ....
>
> So I put another pom.xml in /main-project/moduleA/test?
>
> Ken
>
>
> On Sat, Jun 9, 2012 at 1:16 AM, Manfred Moser <manfred@mosabuam.com> wrote:
>
>> Pull the test code out into a separate module that makes everything
>> available you need in there.. and run the test there.
>>
>> manfred
>> http://simpligility.com
>>
>> On Fri, June 8, 2012 9:32 pm, Ken E wrote:
>> > I am working on modernizing an older project to be used with Maven. The
>> > project is very large and has around 30 modules in it.
>> >
>> > As far as the main source code is concerned, I managed to get all of it
>> to
>> > compile and establish the dependencies correctly. It actually works and
>> it
>> > can be run through Maven's tomcat plugin.
>> >
>> > The problem is with compiling the tests.
>> >
>> > Unfortunately, this company did not apply the same dependency
>> restrictions
>> > for their test code as they did with their main source code.
>> >
>> > For example, C depends on B, and B depends on A in the main source code.
>> > However, A depends on C to run its tests. Obviously, Maven is going to
>> > complain and say there is a cyclic dependency.
>> >
>> > Besides out-right fixing the code (which is sadly not going to happen on
>> > this project - it's tens of millions of lines), is there any way to tell
>> > Maven, "Please compile ALL of the main source code first, then compile
>> ALL
>> > of the test code afterward" ? Or is there any other solution around this
>> > problem?
>> >
>> > Many Thanks,
>> > Ken
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

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


Mime
View raw message