Maven:资源二进制文件在构建后更改文件大小 [英] Maven: resource binary changes file size after build

查看:27
本文介绍了Maven:资源二进制文件在构建后更改文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 appengine-maven-plugin 来构建我的 Java Google App Engine 项目.

I am using the appengine-maven-plugin to build my Java Google App Engine project.

我在 WEB-INF 子文件夹中包含 .p12 证书

I include .p12 certificates in a WEB-INF sub-folder

当我构建我的应用程序时,证书的文件大小增加了几个 KB.这使其无效.我也看到 .jks 证书发生了同样的情况.

When I build my application, the filesize of the certificate increases by a few KB. This renders it invalid. I have seen the same happen to .jks certificates too.

我已经验证了预构建证书的有效性,并使用相同的方法确认了构建后证书的无效性.

I have verified the validity of the certificate pre-build and used the same method to confirm the invalidity of the post-build certificate.

谁能告诉我为什么文件大小会发生变化以及为什么不简单地将其复制到 WAR 中?

Can anyone tell me why the file size is changing and why it is not simply copied to the WAR?

感谢您的帮助.

推荐答案

另一种解决方案是通过添加以下配置来禁用整个项目中的 .p12 文件过滤:

Another solution is to disable filtering of .p12 files throughout your project by adding the following config:

<build>
  ...
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-resources-plugin</artifactId>                
      <configuration>
        <nonFilteredFileExtensions>
          <nonFilteredFileExtension>p12</nonFilteredFileExtension>
        </nonFilteredFileExtensions>
      </configuration>
    </plugin>
  </plugins>
</build>

这篇关于Maven:资源二进制文件在构建后更改文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆