You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2023/07/03 14:33:11 UTC

[sling-org-apache-sling-xss] 01/01: SLING-11882 shade guava library to avoid classpath problems in unit tests

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch feature/SLING-11882-shade
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-xss.git

commit 6542e8ada0cf517ea29044e3bdc2285499af902f
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Mon Jul 3 16:32:57 2023 +0200

    SLING-11882 shade guava library to avoid classpath problems in unit tests
---
 pom.xml | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/pom.xml b/pom.xml
index 14cbeec..fa29a6a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -172,6 +172,33 @@
                     </includes>
                 </configuration>
             </plugin>
+            <!-- Shade 3rdparty libs to avoid classpath conflicts in unit tests -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <artifactSet>
+                        <includes>
+                            <include>com.google.guava:*</include>
+                        </includes>
+                    </artifactSet>
+                    <createSourcesJar>true</createSourcesJar>
+                    <relocations>
+                        <relocation>
+                            <pattern>com.google.common</pattern>
+                            <shadedPattern>sling-xss.com.google.common</shadedPattern>
+                        </relocation>
+                     </relocations>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>