2

I'm using shade plugin to shade org.apache.poi jar because there is an old version on Tomcat server. I have a problem because this jar makes reference to others jars (commons-compress, xmlbeans, commons-collections). How can I shade not only this jar but also its references jars?

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>3.2.4</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <shadedClassifierName>shaded</shadedClassifierName>
                <shadedArtifactAttached>true</shadedArtifactAttached>
                <relocations>
                    <relocation>
                        <pattern>org.apache.poi</pattern>
                        <shadedPattern>hidden.org.apache</shadedPattern>
                    </relocation>
                </relocations>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/maven/**/*</exclude>
                            <exclude>META-INF/*.SF</exclude>
                            <exclude>META-INF/*.DSA</exclude>
                            <exclude>META-INF/*.RSA</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
        </execution>
    </executions>
</plugin>

I tried to relocate all the jars but it's impossible.

Aldo Inácio da Silva
  • 824
  • 2
  • 14
  • 38
  • 1
    Why do you want to relocate its dependencies as well? Are they conflicting as well? If not what prevents them from keeping their original package name? – Marcono1234 Sep 01 '20 at 15:05
  • Are they conflicting as well? EXACTLY. Because all the dependencies have old version on Tomcat inside Pentaho. – Aldo Inácio da Silva Sep 01 '20 at 16:57

1 Answers1

0

I put all the logic on an external microservice and called from inside Pentaho. I don't know if it is the best solution but I couldn't find another one.

Aldo Inácio da Silva
  • 824
  • 2
  • 14
  • 38