MuleSoft Maven plugin fails after issuing a "mvn deploy" command with the following error:
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 00.000 s [INFO] Finished at: 2018-10-01T00:00:00+01:00 [INFO] Final Memory: xxM/xxM [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy (default-deploy) on project project-name: NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]
Same error is showing for "mvn install":
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install (default-install) on project project-name: NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'. -> [Help 1]
A newer version of the Maven Install Plugin (3.0.0-M1) is available on the Maven public repositories. By default, Mule does not define a version for this plugin and picks the latest version, which fails at the install phase.
Recommended solution:
If you are using Anypoint Studio to develop your project. Update mule.tools.version in your Project's pom.xml to version 1.7
<mule.tools.version>1.7</mule.tools.version>
Please make sure this property is being used by the mule-app-maven-plugin plugin
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-app-maven-plugin</artifactId>
<version>${mule.tools.version}</version>
<extensions>true</extensions>
...
</plugin>
Or, if you are not using mule.tools.version property, you can modify mule-app-maven-plugin version directly :
<plugin>
<groupId>org.mule.tools.maven</groupId>
<artifactId>mule-app-maven-plugin</artifactId>
<version>1.7</version>
<extensions>true</extensions>
...
</plugin>
If after applying this solution you see the following error:
[ERROR] Unresolveable build extension: Plugin org.mule.tools.maven:mule-app-maven-plugin:1.7 or one of its dependencies could not be resolved: Could not find artifact org.mule.tools:mule-artifact-archiver:jar:1.2-SNAPSHOT @
that is a problem in the initial version of the fix that has now been updated. To correct execute the following Maven command from the project directory:
mvn dependency:purge-local-repository -DmanualInclude="org.mule.tools.maven:mule-app-maven-plugin:1.7"
That will remove the earlier version and the next build will use the updated release.
Instead of using the fixed version of the mule-app-maven-plugin, you can update the pom specifying the compatible Maven plugins version to be used explicitly:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
001117945

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.