how to fix build errors for Maven Mulesoft code

how to fix build errors for Maven Mulesoft code

org.mule.tooling.maven.ui plugin error
unknown packaging: mule-application
mule maven plugin rtf
mvn clean package -dskipmunittests has encountered a problem
anypoint studio update maven dependencies
anypoint maven plugin
failed to execute goal org apache maven plugins maven-deploy-plugin:2.8 2 deploy
mule-plugin development

I'm trying to build mulesoft code with maven in Bamboo.Build was successfull but now giving errors as below. I'm using Bamboo 6.5.0 and jdk 1.8. with Maven 3. The error details are as below and my pom.xml, settings.xml as well ! Any inputs appreciated !

    build   01-Oct-2018 11:46:02    Caused by: org.apache.maven.plugin.MojoExecutionException: NoFileAssignedException
build   01-Oct-2018 11:46:02        at org.apache.maven.plugins.install.InstallMojo.installProject(InstallMojo.java:152)
build   01-Oct-2018 11:46:02        at org.apache.maven.plugins.install.InstallMojo.execute(InstallMojo.java:108)
build   01-Oct-2018 11:46:02        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
build   01-Oct-2018 11:46:02        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
build   01-Oct-2018 11:46:02        ... 20 more
build   01-Oct-2018 11:46:02    Caused by: org.apache.maven.shared.transfer.project.NoFileAssignedException: The packaging plugin for this project did not assign a main file to the project but it has attachments. Change packaging to 'pom'.
build   01-Oct-2018 11:46:02        at org.apache.maven.shared.transfer.project.install.internal.DefaultProjectInstaller.install(DefaultProjectInstaller.java:116)
build   01-Oct-2018 11:46:02        at org.apache.maven.plugins.install.InstallMojo.installProject(InstallMojo.java:140)
build   01-Oct-2018 11:46:02        ... 23 more

My pom.xml and settings.xml look as below.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mule</groupId>
    <artifactId>mycontacts-mule-api</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>mule</packaging>
    <name>Mule mycontacts-mule-api Application</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <mule.version>3.9.0</mule.version>

        <mule.munit.support.version>3.9.1</mule.munit.support.version>
        <munit.version>1.3.7</munit.version>

        <mule.tools.version>1.2</mule.tools.version>
        <application-name>mycontacts-mule-api</application-name>

        <proxy.api.version>1.0:15535407</proxy.api.version>
        <implementation.host>null</implementation.host>
        <implementation.port>80</implementation.port>
        <implementation.path>/api</implementation.path>
    </properties>
    <distributionManagement>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://prdbambap02:8081/artifactory/libs-release</url>
        </repository>
        <snapshotRepository>
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://prdbambap02:8081/artifactory/libs-snapshot</url>
        </snapshotRepository>
    </distributionManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-app-maven-plugin</artifactId>
                <version>${mule.tools.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <copyToAppsDirectory>true</copyToAppsDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-resource</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/app/</directory>
                                </resource>
                                <resource>
                                    <directory>mappings/</directory>
                                </resource>
                                <resource>
                                    <directory>src/main/api/</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <testResources>
            <testResource>
                <directory>src/test/munit</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>

    </build>

    <!-- Mule Dependencies -->
    <dependencies>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb</groupId>
            <artifactId>mule-core-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Xml configuration -->
        <dependency>
            <groupId>com.mulesoft.muleesb.modules</groupId>
            <artifactId>mule-module-spring-config-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Transports -->
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-file</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jdbc-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.muleesb.transports</groupId>
            <artifactId>mule-transport-jms-ee</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.transports</groupId>
            <artifactId>mule-transport-vm</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Mule Modules -->
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-scripting</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-xml</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- for testing -->
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-functional</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-apikit</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- dependencies for Mule CoE Begins -->
        <!-- https://mvnrepository.com/artifact/guru.nidi.raml/raml-tester-standalone -->
        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-proxy</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-raml-el-gw</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>


        <!--<dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId> mule-module-spring-config-gw</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency> -->

        <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>mule-module-spring-config-gw</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>api-gateway-client</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
         </dependency>
         <dependency>
            <groupId>com.mulesoft.anypoint</groupId>
            <artifactId>gateway-core</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
         </dependency>

        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>mule-munit-support</artifactId>
            <version>${mule.munit.support.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-runner</artifactId>
            <version>${munit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit.utils</groupId>
            <artifactId>munit-dbserver-module</artifactId>
            <version>1.1.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-db</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-ws</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.weave</groupId>
            <artifactId>mule-plugin-weave</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-json</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-cxf</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- dependencies for Mule CoE Ends -->
    </dependencies>

    <repositories>
        <repository>
            <id>Central</id>
            <name>Central</name>
            <url>http://repo1.maven.org/maven2/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>mulesoft-release</id>
            <name>mulesoft release repository</name>
            <layout>default</layout>
            <url>http://repository.mulesoft.org/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>

and my settings.xml as below

<?xml version="1.0" encoding="UTF-8"?>
<settings
    xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <pluginGroups>
        <pluginGroup>org.mule.tools</pluginGroup>
    </pluginGroups>
    <servers>
        <server>
            <id>mule-ee-repo</id>
            <username>balalba</username>
            <password>blbalbab</password>
        </server>
    </servers>
    <mirrors></mirrors>
    <profiles>
        <profile>
            <id>mule-ee-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <mule-maven-plugin-version>2.2.1</mule-maven-plugin-version>
                <mule-username>username</mule-username>
                <mule-password>password</mule-password>
                <mule-client-id>blbalbalbal</mule-client-id>
                <mule-client-secret>blablblalbalba</mule-client-secret>
                <deployment-type>cloudhub</deployment-type>

                <business-group>group</business-group>


                <target-name>null</target-name>
                <target-type>null</target-type>
                <worker-size>Micro</worker-size>
                <worker-count>1</worker-count>
                <env-name>SIT</env-name>
            </properties>
            <repositories>
                <repository>
                    <id>mule-ee-repo</id>
                    <name>mule-ee-repo</name>
                    <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
                    <layout>default</layout>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>mule-ee-profile</activeProfile>
    </activeProfiles>
</settings>

Official support message:

https://support.mulesoft.com/s/article/Mule-Maven-Plugin-fails-during-deploy-with-error-Failed-to-execute-goal-org-apache-maven-plugins-maven-deploy-plugin-3-0-0-M1-deploy

Cause:

A new version of the Maven Install Plugin has been published on the Maven public repositories (3.0.0-M1). By default, Mule doesn't define a version for this plugin and picks the last one.

The page lists the following as a temporary solution, and suggests refreshing the above link for updates.

Update pom.xml to specify the Maven version to be used by the Mule Maven plugin:

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


New - the above is the original solution, which is now the alternative solution. The recommended solution is:

Update mule.tools.version in pom.xml:

<mule.tools.version>1.7</mule.tools.version>

And make sure this property is used by mule-app-maven-plugin:

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-app-maven-plugin</artifactId>
    <version>${mule.tools.version}</version>
    <extensions>true</extensions>
    ...
</plugin>

If you then get an error about unresolvable build extension, run the following from the project directory:

mvn dependency:purge-local-repository -DmanualInclude="org.mule.tools.maven:mule-app-maven-plugin:1.7"

how to fix build errors for Maven Mulesoft code - maven - html, how to fix build errors for Maven Mulesoft code - maven. 6.5.0 and jdk 1.8. with Maven 3. The error details are as below and my pom.xml, settings.xml as well ! Wondering how to build a Mulesoft project using Maven. Maven is a project management utility that can be used to develop projects in Mulesoft’s Anypoint Plat


Apache Maven deployed a new version of the Maven Install Plugin to their repositories. It doesn't seem that it should have gone to the Public Repo, but still.

The solution is to fix the Maven plugin version in the Mule POM file.

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

Mule Maven Plugin fails during deploy/install with error: Failed to , Mule Maven Plugin fails during deploy/install with error: Failed to execute goal [ERROR] Unresolveable build extension: Plugin  This is because by default Apache Maven will use the Maven Compiler Plugin plugin to compile the code, which will use the JDK tools.jar library, but the default JRE in Eclipse will not contain this library. So what is the solution to fix this error? I would like to guide you as follows: On the Eclipse menu, go to Window -> Preferences.


It looks like it is problem with incompatibility between new maven install plugin and mulesoft code. In my case it helped to use older install plugin - define in pluginManagement desired version of install maven plugin to use:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.5.2</version>
    </plugin>

Error on building Maven project due to lack of third party external , Error message such as Failed to read artifact descriptor for are shown with maven based project builds relating to a Failure to find a specific [ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.1.6:process-​sources code that rely on a second repository to provide thrid party code. What did the trick in the end was to go to Project -> Properties -> Java Build Path, click on the Mule Server 3.7.2 EE entry, hit Edit, reselect the same version of the server runtime, click Finish, click Ok.


Please update the plugin to version 1.7, that should fix the problem.

<plugin>
  <groupId>org.mule.tools.maven</groupId>
  <artifactId>mule-app-maven-plugin</artifactId>
  <version>1.7</version>
  <extensions>true</extensions>
  <configuration>
    <copyToAppsDirectory>true</copyToAppsDirectory>
  </configuration>
</plugin>

Error compiling MuleSoft Runtime from Source Code, Hi,. I am having an error when trying to compile MuleSoft from source code. $ mvn clean package. [INFO] Scanning for projects [INFO]. In order to debug you need some code that runs. A failed build means the code cannot be compiled => there is nothing to run. Or maybe there is a previous successful build and there is something to run and debug but it is not the current code. You don't want to continue, you have to fix the errors first. – axiac May 25 '18 at 11:09


Same issue here, which happens because of new version of maven-install-plugin (3.0.0-M1). Solution for my case is to skip installation of project with custom packaging (karaf-assembly) so adding following snippet in related pom.xml does it:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <configuration>
       <skip>true</skip>
    </configuration>
</plugin>

Of course, built artifacts will not end in .m2 directory, but that is ok in my case.

Mule maven project build error, [ERROR] Unresolveable build extension: Plugin org.mule.tools.maven:mule-app-​maven-plugin:1.2 or one of its dependencies could not be  The mule-maven-plugin is a Maven Plugin provided as a part of the Mule Framework. It allows us to run integration tests for Mule applications, and also to deploy any application to various environments.


maven error, Hi Folks,. When trying to build project using maven and with below settings.xml, I'​m continuously seeing this error. [INFO] Downloading:  A somewhat “hidden feature” of the Mule Maven Plugin is the ability to use stored encrypted Anypoint user credentials in deployments. Normally, when deploying an application using a deployment strategy , the user either sets plain text credentials in the application’s POM, or injects them into the plugin configuration through the command line, or sets them through a property.


Mule project builds fail with "not authorized" error attempting to , Mule project builds fail when using Maven, with an error similar to: [ERROR] Failed to execute goal on project myapp-myname: Could not  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:


Maven Error: Failed to collect dependencies, Maven Error: Failed to collect dependencies - When trying to run the process. Hi <artifactId>build-helper-maven-plugin</artifactId>; <version>1.7</version>  Mule Maven Plugin 3.1.0 is the first iteration after our major release of Mule Maven Plugin 3. We have manage to fix a small number of issues that were affecting the product and also added several key features that were intentionally left out of Mule Maven Plugin 3.0.0.