web-dev-qa-db-ja.com

アセンブリの読み取りエラー:アセンブリ記述子が見つかりません

プロジェクトをビルドすると、Error reading assemblies: No Assembly descriptors foundが返されます。 .shファイルにアクセス許可を設定し、アプリケーションをクラッシュさせる厄介な.jarファイルを除外しようとしています...

私のmaven-Assemblyプラグインは、pom.xmlファイルに次のように追加されます。

<plugin>
       <artifactId>maven-Assembly-plugin</artifactId>
       <version>2.2.1</version>
       <executions>
       <execution>
           <id>make-Assembly</id>
           <phase>package</phase>
           <goals>
             <goal>single</goal>
           </goals>
           <configuration>
           <descriptors>
             <descriptor>src/main/Assembly/src.xml</descriptor>
           </descriptors>
           </configuration>
      </execution>
      </executions> 
</plugin>

私のアセンブリ記述子は次のようになります。

<Assembly xmlns="http://maven.Apache.org/plugins/maven-Assembly-plugin/Assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.Apache.org/plugins/maven-Assembly-plugin/Assembly/1.1.2 http://maven.Apache.org/xsd/Assembly-1.1.2.xsd">
  <id>my-Assembly-descriptor</id>
  <formats>
    <format>jar</format>
    <format>war</format>
  </formats>
  <fileSets>
        <fileSet>
            <directory>${project.build.directory}</directory>
            <outputDirectory>${project.build.directory}</outputDirectory>
            <includes>
                <include>*.sh</include>
            </includes>
            <fileMode>0755</fileMode>
        </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
        <excludes>
        <exclude>spring-2.5.4.jar</exclude>
      </excludes>
    </dependencySet>
  </dependencySets>
</Assembly>

私のプロジェクトの構造は次のとおりです。

Interface - src - main - Assembly - src.xml

          - pom.xml

[別のユーザーとして実行]-> [別のユーザーとしてデバッグ]を実行しようとすると、Assembly:single

同じエラーが発生します。コンソールでAssembly:assemblyを試しましたが、何も得られませんでした。アセンブリ記述子に間違ったパスを入れようとしましたが、エラーは変わりませんでした。アセンブリ記述子へのパスの前に${basedir}/を置くと、同じ結果になります。

Ubuntu 10.10 Maverick Meerkatがあり、Eclipse EEで作業しています...

ありがとう!

30
Luli

私はバージョン2.maven-Assembly-pluginを使用していますが、問題は同じだと思います。アセンブリ構成が実行内で宣言されている場合、mvn packageから機能しますが、 mvn Assembly:assemblyからは機能しません。

私が見つけた解決策は、プラグインのトップレベル設定で設定を宣言し、実行を可能な限り小さくすることです:

<plugin>
    <groupId>org.Apache.maven.plugins</groupId>
    <artifactId>maven-Assembly-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <descriptors>
            <descriptor>src/main/Assembly/standalone.xml</descriptor>
        </descriptors>
        <finalName>standalone</finalName>
    </configuration>
    <executions>
        <execution>
            <id>standalone</id>
            <phase>package</phase>
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
    </executions>
</plugin>
25
edrabc

<build>...<pluginManagement>...<plugins>でAssemblyプラグインを設定したようです。 <build>...<plugins>でプラグインを設定すれば機能するはずです。

<build>
  <plugins>
    <plugin>
      <artifactId>maven-Assembly-plugin</artifactId>
      <version>2.2.1</version>
      <executions>
        <execution>
          <id>make-Assembly</id>
          <phase>package</phase>
          <goals>
            <goal>single</goal>
          </goals>
          <configuration>
            <descriptors>
              <descriptor>src/main/Assembly/src.xml</descriptor>
            </descriptors>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
5
Stefan Ferstl