SLING-6409 shade beanutils as well, and fix package imports
authorStefan Seifert <sseifert@apache.org>
Sat, 17 Dec 2016 20:00:19 +0000 (20:00 +0000)
committerStefan Seifert <sseifert@apache.org>
Sat, 17 Dec 2016 20:00:19 +0000 (20:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1774797 13f79535-47bb-0310-9956-ffa450edef68

pom.xml

diff --git a/pom.xml b/pom.xml
index 104f3c7..0a43cb7 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
+                <configuration>
+                  <instructions>
+                    <!-- Remove those package imports because embedded and relocated via shade plugin (see below) -->
+                    <Import-Package>
+                      !org.apache.sling.commons.osgi,
+                      !org.apache.sling.scripting.core.impl.helper,
+                      !org.apache.commons.beanutils,
+                      *
+                    </Import-Package>
+                  </instructions>
+                </configuration>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -67,6 +78,7 @@
                                 <includes>
                                     <include>org.apache.sling:org.apache.sling.commons.osgi</include>
                                     <include>org.apache.sling:org.apache.sling.scripting.core</include>
+                                    <include>commons-beanutils:commons-beanutils</include>
                                 </includes>
                             </artifactSet>
                             <relocations>
                                     <pattern>org.apache.sling.scripting.core</pattern>
                                     <shadedPattern>slingmodelsimpl.org.apache.sling.scripting.core</shadedPattern>
                                 </relocation>
+                                <relocation>
+                                    <pattern>org.apache.commons.beanutils</pattern>
+                                    <shadedPattern>slingmodelsimpl.org.apache.commons.beanutils</shadedPattern>
+                                </relocation>
                             </relocations>
                             <filters>
                                 <filter>
                                         <include>org/apache/sling/scripting/core/impl/helper/ProtectedBindings*</include>
                                     </includes>
                                 </filter>
+                                <filter>
+                                    <artifact>commons-beanutils:commons-beanutils</artifact>
+                                    <includes>
+                                        <include>org/apache/commons/beanutils/*</include>
+                                    </includes>
+                                </filter>
                             </filters>
                         </configuration>
                     </execution>
             <version>2.0.20</version>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-            <version>2.5</version>
-            <scope>provided</scope>
-        </dependency>
+        <!-- Artifact is shaded and inlined, only some classes included (see above) -->
         <dependency>
             <groupId>commons-beanutils</groupId>
             <artifactId>commons-beanutils</artifactId>
             <scope>compile</scope>
         </dependency>
         <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <version>2.5</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>com.google.code.findbugs</groupId>
             <artifactId>jsr305</artifactId>
             <version>3.0.0</version>