Chris B. Anilao
Chris B. Anilao

Reputation: 73

Maven Shade minimizeJar shreds H2 even when configured not to

Has anybody ever used maven shade's minimizejar feature while using H2?

Like the documentation I configured the pom.xml file to have minimizejar to ignore H2

              <minimizeJar>true</minimizeJar>
              <filters>
                <filter>
                   <artifact>com.h2database:h2</artifact>
                   <includes>
                       <include>**</include>
                   </includes>
                </filter>
...

minimizeJar shreds H2 and many critical class files are missing (like Driver.class and Engine.class) This seems to not happen with other packages from Maven.

My full pom.xml is here (w/o the minimizeJar feature).

Upvotes: 1

Views: 291

Answers (1)

Chris B. Anilao
Chris B. Anilao

Reputation: 73

The issue was the version of maven-shade was too old. The feature for ignoring files was deployed in maven-shade 1.6.

"As of version 1.6, minimizeJar will respect classes that were specifically marked for inclusion in a filter."

Upvotes: 1

Related Questions