Search code examples
javaspring-bootmavenbuildmaven-assembly-plugin

Error reading assemblies: Descriptor with ID <xml path> not found


I've been trying to migrate my projects from Java 8 to Java 11. So far, I've also updated my Spring boot projects and was able to find solutions to the issues that came up. Although for this one, I'm having some difficulty resolving it. My Maven version is 3.6.1.

Initially, the value of my maven assembly plugin is like this:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <configuration>
        <appendAssemblyId>false</appendAssemblyId>
        <descriptor>src/main/assembly/boot.xml</descriptor>
    </configuration>
    <executions>
        <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Although it throws an error that says this:

Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:3.1.1:single failed: parameter 'descriptor' has been removed from the plugin, please verify documentation. -> [Help 1]

According to the maven assembly documentation, the use of descriptor was always incorrect. And so I've updated it to this:

<configuration>
    <appendAssemblyId>false</appendAssemblyId>
    <descriptorRefs>
      <descriptorRef>src/main/assembly/boot.xml</descriptorRef>
    </descriptorRefs>
</configuration>

Although it still does not work. It throws an error like this:

Error reading assemblies: Descriptor with ID 'src/main/assembly/boot.xml' not found -> [Help 1]

Even though the boot.xml is existing.

enter image description here

Any other suggestions on how I can resolve this? Thank you in advance!


Solution

  • Well, I've just returned to my previous configuration and added descriptors tags. It now looks like this:

    <descriptors>
        <descriptor>src/main/assembly/boot.xml</descriptor>
    </descriptors>
    

    And it worked!