Error reading assemblies: No assembly descriptors found

≯℡__Kan透↙ 提交于 2019-11-30 07:55:52

I have been using version 2.3 of maven-assembly-plugin, but I believe the problem is the same: if the assembly configuration is declared inside an execution, it works from mvn package, but does not work from mvn assembly:assembly.

The solution I have found is to declare the configuration in the top-level configuration of the plugin, and keep the execution as small as possible:

<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>

It seems that you have configured the assembly plugin in <build>...<pluginManagement>...<plugins>. It should work if you configure the plugin in <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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!