war ファイルを作成しているときに、ある場所から war 内のフォルダーに一連の jar ファイルをコピーしています。ファイルはコピーされますが、戦争の外に持ち出されたときにjarの同じクラスファイルがデバッガーで開かれ、戦争ファイルから取った後に開かれないため、破損していると思います。
これは、jar をコピーする私の war pom.xml の一部です。
<execution>
<id>copy-jars</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/${project.artifactId}-${buildNumber}/somefolder</outputDirectory>
<resources>
<resource>
<directory>SomeSourceDirectory</directory>
<filtering>true</filtering>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
SomeSourceDirectoryには、いくつかの jar ファイルといくつかの他のファイルがあります。結果は myWar/somefolder/a.jar ですが、デバッガーでこの jar ファイル内のクラスを開くと、WinZip でエラーが発生します。
Invalid compressed data to extract.
Severe Error: Compressed data is invalid
ただし、元のフォルダー、つまり戦争の外で表示すると、同じクラスファイルを表示できます。では、jar のコピー中に間違いはありますか? ありがとう。