mvn test failing with

 [INFO]
    [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ project-name ---
    [INFO]
    [INFO] --- scalatest-maven-plugin:1.0:test (test) @ project-name ---
    Discovery starting.
    *** RUN ABORTED ***
      java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
      at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:330)
      at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:263)
      at java.util.jar.JarVerifier.processEntry(JarVerifier.java:318)
      at java.util.jar.JarVerifier.update(JarVerifier.java:230)
      at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
      at java.util.jar.JarFile.ensureInitialization(JarFile.java:617)
      at java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
      at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:991)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:74)

I have searched lot of answers in sof & in Apache mailing list, in all of them it was a problem with maven shade plugin, and people were facing during mvn package or mvn install phase. But in my case I am not using maven shade plugin, only the following plugins: maven-scala-plugin, scalatest-maven-plugin. And I'm only facing this problem in the 'test' phase.

1

There are 1 best solutions below

0
On

Finally found the issue, there is a dependency on the module, which has shade plugin,in that module's pom filtering out as follows solved the issue:

<filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>