maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: exclusions from a <type>test-jar</type> dependency in maven 3
Date Wed, 18 May 2011 19:19:57 GMT
I the exact same project shows a difference between Maven 2.2.1 and Maven
3.0.3, you should create a jira ticket about a regression.

/Anders

On Wed, May 18, 2011 at 03:01, Garrett Wu <wugarrett@gmail.com> wrote:

> When upgrading to maven 3.0.3, I noticed that <exclusions> are not really
> excluded from dependencies with <type>test-jar</type>.  Is this intended
> behavior?  If so, I how should I achieve the same effect as maven2?
>
> I have a project maven-test-jar that has a compile scope dependency on
> org.apache.hadoop:avro:1.3.1.
>
>  <groupId>com.foocorp.maven</groupId>
>  <artifactId>maven-test-jar</artifactId>
>  <!-- ... -->
>  <dependencies>
>    <dependency>
>      <groupId>org.apache.hadoop</groupId>
>      <artifactId>avro</artifactId>
>      <version>1.3.1</version>
>      <scope>compile</scope>
>    </dependency>
>  </dependencies>
>
> I have another project that depends on maven-test-jar's tests, and I would
> like to use org.apache.avro:avro:1.4.1 instead of
> org.apache.hadoop:avro:1.3.1.
>
>  <!-- ... -->
>  <dependencies>
>    <dependency>
>      <groupId>com.foocorp.maven</groupId>
>      <artifactId>maven-test-jar</artifactId>
>      <version>1.0-SNAPSHOT</version>
>      <scope>test</scope>
>      <type>test-jar</type>
>      <exclusions>
>        <exclusion>
>          <groupId>org.apache.hadoop</groupId>
>          <artifactId>avro</artifactId>
>        </exclusion>
>      </exclusions>
>    </dependency>
>    <dependency>
>      <groupId>org.apache.avro</groupId>
>      <artifactId>avro</artifactId>
>      <version>1.4.1</version>
>      <scope>compile</scope>
>    </dependency>
>  </dependencies>
>
> However, a dependency:list shows that it still uses
> org.apache.hadoop:avro:1.3.1 for the test scope:
>
> $ mvn dependency:list
> ...
> [INFO]    org.apache.avro:avro:jar:1.4.1:compile
> [INFO]    org.apache.hadoop:avro:jar:1.3.1:test
> ...
>
> In maven 2, org.apache.hadoop:avro:jar:1.3.1:test is omitted as I would
> expect.
>
> Thanks,
> Garrett
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message