Update to shade plugin 2.2 to shade test artifact as well

When we want to use test artifact in other projects, dependencies
are not shaded as for core artifact.

Issue opened in maven shade project: [MSHADE-158](http://jira.codehaus.org/browse/MSHADE-158)

When using it in other projects, you basically need to change your `pom.xml` file:

```xml
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>${elasticsearch.version}</version>
    <type>test-jar</type>
    <scope>test</scope>
</dependency>
```

You can also define some properties:

```xml
<properties>
    <tests.jvms>1</tests.jvms>
    <tests.shuffle>true</tests.shuffle>
    <tests.output>onerror</tests.output>
    <tests.client.ratio></tests.client.ratio>
    <es.logger.level>INFO</es.logger.level>
</properties>
```

Closes #4266
This commit is contained in:
David Pilato 2013-11-20 21:45:25 +01:00
parent 5968680b41
commit a9655ba812
1 changed files with 11 additions and 1 deletions

12
pom.xml
View File

@ -60,6 +60,13 @@
<version>${lucene.version}</version> <version>${lucene.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>randomizedtesting-runner</artifactId>
<version>2.0.10</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.apache.lucene</groupId> <groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId> <artifactId>lucene-core</artifactId>
@ -432,7 +439,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.1</version> <version>2.2</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -442,7 +449,9 @@
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<shadeTestJar>true</shadeTestJar>
<minimizeJar>true</minimizeJar> <minimizeJar>true</minimizeJar>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<artifactSet> <artifactSet>
<includes> <includes>
<include>com.google.guava:guava</include> <include>com.google.guava:guava</include>
@ -987,6 +996,7 @@
<version>2.3.2</version> <version>2.3.2</version>
<executions> <executions>
<execution> <execution>
<phase>prepare-package</phase>
<goals> <goals>
<goal>test-jar</goal> <goal>test-jar</goal>
</goals> </goals>