How to remove signatures from all the dependencies of a WAR module in maven?

Viewed 120

I have a maven module, which is packaged as WAR. It is actually a spring-boot application and I am using the maven-spring-boot-plugin, which creates two WAR archives - one standalone and one original.

I have updated some of the dependencies and now every time I deploy my WAR I get an exception

 java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

From what I understand, the reason is, that some of the JAR dependencies put into the WEB-INF/lib folder contain signature files, which can not be validated. Now, the question is, how do I setup maven to remove these signature files (and probably also the signature entries in the manifest files) before spring-boot maven plugin creates the final WAR file?

Following is my spring-boot maven plugin configuration:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>com.sample.MainClass</mainClass>
        <classifier>standalone</classifier>
    </configuration>
</plugin>
0 Answers
Related