Browse Source

[BUILD] Don't shade core artifacts

This commit adds an additioal jar that is shaded and keeps all the
artifacts that are used by default on the server-side unshaded. Users
that need a shaded jar can now use the `shaded` classifyer to pull
the shaded minimized jar in instead. Including the shaded jar in a
downstream project looks like this:

```XML
<dependency>
  <groupId>org.elasticsearch</groupId>
  <artifactId>elasticsearch</artifactId>
  <classifier>shaded</classifier>
</dependency>
```
Simon Willnauer 10 years ago
parent
commit
4c981ff4bf
3 changed files with 18 additions and 7 deletions
  1. 4 3
      core/pom.xml
  2. 14 0
      core/src/main/assemblies/common-bin.xml
  3. 0 4
      pom.xml

+ 4 - 3
core/pom.xml

@@ -18,8 +18,6 @@
 
 
 
 
     <properties>
     <properties>
-        <!-- testing is currently done unshaded :( -->
-        <elasticsearch.thirdparty.config>unshaded</elasticsearch.thirdparty.config>
         <!-- Properties used for building RPM & DEB packages (see common/packaging.properties) -->
         <!-- Properties used for building RPM & DEB packages (see common/packaging.properties) -->
         <packaging.elasticsearch.home.dir>/usr/share/elasticsearch</packaging.elasticsearch.home.dir>
         <packaging.elasticsearch.home.dir>/usr/share/elasticsearch</packaging.elasticsearch.home.dir>
         <packaging.elasticsearch.bin.dir>/usr/share/elasticsearch/bin</packaging.elasticsearch.bin.dir>
         <packaging.elasticsearch.bin.dir>/usr/share/elasticsearch/bin</packaging.elasticsearch.bin.dir>
@@ -415,9 +413,12 @@
                     </execution>
                     </execution>
                 </executions>
                 </executions>
                 <configuration>
                 <configuration>
-                    <shadeTestJar>true</shadeTestJar>
+                    <shadedArtifactAttached>true</shadedArtifactAttached>
+                    <shadedClassifierName>shaded</shadedClassifierName>
+                    <shadeTestJar>false</shadeTestJar>
                     <minimizeJar>true</minimizeJar>
                     <minimizeJar>true</minimizeJar>
                     <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
                     <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
+                    <createDependencyReducedPom>false</createDependencyReducedPom>
                     <artifactSet>
                     <artifactSet>
                         <includes>
                         <includes>
                             <include>com.google.guava:guava</include>
                             <include>com.google.guava:guava</include>

+ 14 - 0
core/src/main/assemblies/common-bin.xml

@@ -11,6 +11,20 @@
                 <include>com.spatial4j:spatial4j</include>
                 <include>com.spatial4j:spatial4j</include>
                 <include>com.vividsolutions:jts</include>
                 <include>com.vividsolutions:jts</include>
                 <include>org.codehaus.groovy:groovy-all</include>
                 <include>org.codehaus.groovy:groovy-all</include>
+                <include>com.google.guava:guava</include>
+                <include>com.carrotsearch:hppc</include>
+                <include>com.fasterxml.jackson.core:jackson-core</include>
+                <include>com.fasterxml.jackson.dataformat:jackson-dataformat-smile</include>
+                <include>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml</include>
+                <include>com.fasterxml.jackson.dataformat:jackson-dataformat-cbor</include>
+                <include>joda-time:joda-time</include>
+                <include>org.joda:joda-convert</include>
+                <include>io.netty:netty</include>
+                <include>com.ning:compress-lzf</include>
+                <include>com.github.spullara.mustache.java:compiler</include>
+                <include>com.tdunning:t-digest</include>
+                <include>org.apache.commons:commons-lang3</include>
+                <include>commons-cli:commons-cli</include>
             </includes>
             </includes>
         </dependencySet>
         </dependencySet>
         <dependencySet>
         <dependencySet>

+ 0 - 4
pom.xml

@@ -760,8 +760,6 @@
                                      <internalRuntimeForbidden>true</internalRuntimeForbidden>
                                      <internalRuntimeForbidden>true</internalRuntimeForbidden>
                                      <!-- if the used Java version is too new, don't fail, just do nothing: -->
                                      <!-- if the used Java version is too new, don't fail, just do nothing: -->
                                      <failOnUnsupportedJava>false</failOnUnsupportedJava>
                                      <failOnUnsupportedJava>false</failOnUnsupportedJava>
-                                     <!-- Temporary until we stabilize builds -->
-                                     <failOnUnresolvableSignatures>false</failOnUnresolvableSignatures>
                                      <excludes>
                                      <excludes>
                                          <exclude>jsr166e/**</exclude>
                                          <exclude>jsr166e/**</exclude>
                                      </excludes>
                                      </excludes>
@@ -792,8 +790,6 @@
                                  <internalRuntimeForbidden>true</internalRuntimeForbidden>
                                  <internalRuntimeForbidden>true</internalRuntimeForbidden>
                                  <!-- if the used Java version is too new, don't fail, just do nothing: -->
                                  <!-- if the used Java version is too new, don't fail, just do nothing: -->
                                  <failOnUnsupportedJava>false</failOnUnsupportedJava>
                                  <failOnUnsupportedJava>false</failOnUnsupportedJava>
-                                 <!-- Temporary until we stabilize builds -->
-                                 <failOnUnresolvableSignatures>false</failOnUnresolvableSignatures>
                                  <bundledSignatures>
                                  <bundledSignatures>
                                      <!-- This will automatically choose the right signatures based on 'targetVersion': -->
                                      <!-- This will automatically choose the right signatures based on 'targetVersion': -->
                                      <bundledSignature>jdk-unsafe</bundledSignature>
                                      <bundledSignature>jdk-unsafe</bundledSignature>