Complete Analysis of Maven Packaging Failures | Common Errors and Solution Guide
Maven Packaging Problem Diagnosis
Plugin Packaging Issues Summary
maven-shade-plugin Packaging Issues
shade for parameter resource: Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ManifestResourceTransformer
Specific error as follows:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (default) on project mqtt-sim: Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade for parameter resource: Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ManifestResourceTransformer -> [Help 1]
But there is clearly no resource-related configuration in the plugin configuration; the reason here is:
Because the execution did not have an id written, it conflicted with other tasks without ids, mixing in resource configurations from other tasks, causing failure.
Solution: Add an id
<execution>
<id>ctbots-uniq-id</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
This will resolve the error