Search code examples
mavenmuleanypoint-studio

Anypoint studio - error running project using Maven


I'm trying to run mule application in Anypoint studio using Maven.

I configured env variables for Java home and Maven home.

Maven test inside Anypoint studio passed well.

Maven test

JDK path instead of JRE path configured in Anypointstudio preferences. I also checked all env components to use JDK.

JDK instead of JRE path

Here is my pom.xml file

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>test3</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule</packaging>
<name>Mule test3 Application</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <mule.version>3.8.3</mule.version>
    <mule.tools.version>1.2</mule.tools.version>
</properties>

<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>src/main/api/</directory>
                            </resource>
                            <resource>
                                <directory>mappings/</directory>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</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>

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

When I run app I get following error in console:

Failed to execute goal on project test3: Could not resolve dependencies for project com.mycompany:test3:mule:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.mulesoft.muleesb:mule-core-ee:jar:3.8.3, com.mulesoft.muleesb.modules:mule-module-spring-config-ee:jar:3.8.3, org.mule.transports:mule-transport-file:jar:3.8.3, org.mule.transports:mule-transport-http:jar:3.8.3, com.mulesoft.muleesb.transports:mule-transport-jdbc-ee:jar:3.8.3, com.mulesoft.muleesb.transports:mule-transport-jms-ee:jar:3.8.3, org.mule.transports:mule-transport-vm:jar:3.8.3, org.mule.modules:mule-module-scripting:jar:3.8.3, org.mule.modules:mule-module-xml:jar:3.8.3, org.mule.tests:mule-tests-functional:jar:3.8.3: Failure to find com.mulesoft.muleesb:mule-core-ee:jar:3.8.3 in http:repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]

What could be wrong in configuration? Any Ideas?


Solution

  • you are trying to use enterprise edition libraries without providing the EE repositories. Notice that you also need an account to be able to download the EE repositories.

    Get in touch with Mulesoft Support, they should provide you with a valid username / password ( if you are already using EE license) and provide the settings for the EE repository