首页 > 代码库 > Maven 打包涉及证书文件问题

Maven 打包涉及证书文件问题

 

    当使用maven-assembly-plugin或者maven-shade-plugin打包时,如果涉及到证书文件,一定设置过滤,否则证书文件会被做修改。报异常:

java.io.IOException: DER length more than 4 bytes: 111

  • maven-assembly-plugin:
    <fileSet> 
      <directory>/</directory> 
      <outputDirectory>/</outputDirectory> 
      <includes> 
        <include>**/*.*</include> 
      </includes> 
      <filtered>true</filtered>
    </fileSet>

     

  • maven-shade-plugin:

    <configuration>  
      <filters>  
        <filter>  
          <artifact>*:*</artifact>  
           <excludes>  
          <exclude>*</exclude>  
            </excludes>  
        </filter>  
      </filters>  
    </configuration>  

     

Maven 打包涉及证书文件问题