How can I tell which signed jar is causing maven-shade-plugin to fail?

前端 未结 2 727
半阙折子戏
半阙折子戏 2021-01-03 23:32

To run maven-shade-plugin, I have to use to method described here due to signed dependencies, as shown here:


    maven-shade         


        
2条回答
  •  忘掉有多难
    2021-01-04 00:13

    to get list of signed JARs with Maven and bash+awk+sed, one can try something like this:

    #!/bin/bash
    mvn_classpath=`mvn dependency:build-classpath -B | awk '/Dependencies classpath:/{getline; print}' | sed -e s/:/\\\\n/g`
    
    for jar in $mvn_classpath; do 
            echo -n `jarsigner -verify $jar | grep verified | wc -l`; echo " $jar"; 
    done
    

    This will list JAR files used by your project - those that are signed and verified are preceded by 1, the unsigned by 0. I had no signed JAR that would not be possible to verify, so I'm not sure how the logic should look in this case.

提交回复
热议问题