You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andreas M <an...@gmail.com> on 2009/11/24 10:23:08 UTC

Maven 3 incompatiblity

After I upgraded to the latest m2eclipse the builds of out integration tests
started failing.
The reason was this:
I had set up our integration tests so that I could run one side of the
communication with an older version of our product (for compatibility
tests). I did this by setting up two dependencies for the same artifact,
with different scopes (compile and runtime).  (See example below)
This failed in Maven 3, the error message was that I had two dependencies
with the same version. 

Now, I solved my problem by changing the setup of the tests from using
copy-dependencies to using copy (and all the dependencies spelled out in the
configuration). But the previous solution was nicer, in that copy-dependecy
also brought with it the transitive dependencies as well. Now I had to
duplicate 'em by hand instead.

Question: is this intended behavior? Or should the version check look at the
scope as well?

Example:

<dependency>
  <groupId>com.example</groupId>
  <artifactId>component</artifactId>
  <version>${client-side-version}</version>
  <scope>compile</scope>
</dependency>
<dependency>
  <groupId>com.example</groupId>
  <artifactId>component</artifactId>
  <version>${server-side-version}</version>
  <scope>runtime</scope>
</dependency>

The jars are copied with maven-dependency-plugin:copy-dependency.
When a developer builds client- and server-side-version are the same. During
compatiblility tests one is pointed to the previous version.

-- 
View this message in context: http://old.nabble.com/Maven-3-incompatiblity-tp26492785p26492785.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: Maven 3 incompatiblity

Posted by Anders Hammar <an...@hammar.net>.
I'm not sure I understand your use case fully, but I'm thinking that you
should probably keep your ITs outside of your project. You would then build
your project for a specific version, but could then run the ITs on any other
version. And this strategy could then be extended to run the ITs with
different profiles for using different versions, or even several IT projects
for a set of different pre-defined version.

/Anders

On Tue, Nov 24, 2009 at 10:23, Andreas M <an...@gmail.com>wrote:

>
> After I upgraded to the latest m2eclipse the builds of out integration
> tests
> started failing.
> The reason was this:
> I had set up our integration tests so that I could run one side of the
> communication with an older version of our product (for compatibility
> tests). I did this by setting up two dependencies for the same artifact,
> with different scopes (compile and runtime).  (See example below)
> This failed in Maven 3, the error message was that I had two dependencies
> with the same version.
>
> Now, I solved my problem by changing the setup of the tests from using
> copy-dependencies to using copy (and all the dependencies spelled out in
> the
> configuration). But the previous solution was nicer, in that copy-dependecy
> also brought with it the transitive dependencies as well. Now I had to
> duplicate 'em by hand instead.
>
> Question: is this intended behavior? Or should the version check look at
> the
> scope as well?
>
> Example:
>
> <dependency>
>  <groupId>com.example</groupId>
>  <artifactId>component</artifactId>
>  <version>${client-side-version}</version>
>  <scope>compile</scope>
> </dependency>
> <dependency>
>  <groupId>com.example</groupId>
>  <artifactId>component</artifactId>
>  <version>${server-side-version}</version>
>  <scope>runtime</scope>
> </dependency>
>
> The jars are copied with maven-dependency-plugin:copy-dependency.
> When a developer builds client- and server-side-version are the same.
> During
> compatiblility tests one is pointed to the previous version.
>
> --
> View this message in context:
> http://old.nabble.com/Maven-3-incompatiblity-tp26492785p26492785.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
>
>