0

たくさんのモジュールを備えた大きなMavenプロジェクトがあります。モジュールの1つは、「実際の」開発プロジェクトではありません。最終的なシステムのデータが含まれています。データは、特別なjarを使用してシステムにデプロイされます。pomは、jarがダウンロードされ、他のすべてのデータとバッチファイルがzipにパッケージ化されていることを確認します。Mavenアセンブリプラグインを使用します。このpomファイルにはそれほど魔法はありません。魔法は、Windows圧縮フォルダーでzipファイルを解凍するときに始まります。かなり大きいjarファイル(9MB)のみを認識し、バッチファイルとデータファイル(数KB)は認識しません。私の本当に古いWinzipにはアーティファクトに問題がないため、すぐには気づきませんでした。

誰かがアイデアを持っているか、同様の問題を見たことがありますか?


pomファイルからのプラグイン構成

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
        <descriptors>
            <descriptor>assembly.xml</descriptor>
        </descriptors>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
    </executions>
</plugin>

私のアセンブリxml

<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">

  <formats>
    <format>zip</format>
  </formats>  

  <dependencySets>
    <dependencySet>
      <outputDirectory></outputDirectory>
      <includes>
        <include>com.group:product-development-cli</include>
      </includes>
      <outputFileNameMapping>product-development-cli-${ext.version}.${extension}</outputFileNameMapping>
    </dependencySet>
  </dependencySets>

    <fileSets>
        <fileSet>
            <directory>.</directory>
            <excludes>
                <exclude>pom.xml</exclude>
        <exclude>assembly.xml</exclude>
        <exclude>target</exclude>
            </excludes>
        </fileSet>
    </fileSets>

</assembly>

私のフォルダ構造:モジュール+-data1+-より多くのファイル+-data2+-より多くのファイル+-pom.xml+-assembly.xml+-より多くのファイル

4

2 に答える 2

0

260文字のウィンドウのパス長の制限を超えている可能性はありますか?Windowsの組み込みの圧縮ルーチンは失敗します(他のzipプログラムで処理できる場合でも)。

これは、JARの階層構造により、JARを処理するときに頻繁に発生するようです。

C:\Aたとえば、より短いパスに解凍してみて、それが役立つかどうかを確認できますか?

于 2011-10-04T19:39:31.300 に答える
0

エドワードトムソンに触発されて、私はzipファイルをもう一度見ました。zipファイルには、2つの異なるソース(ファイルセットと依存関係)からのファイルが含まれていました。問題は、fileSetのディレクトリタグでした。(<directory>.</directory>)圧縮フォルダは「。」が好きではありません。パスの真ん中で。

product-0.5.0-SNAPSHOT/./file.txt

もちろん、依存関係はありませんでした.

于 2011-10-20T13:32:27.733 に答える