Mule - error running project with Maven

user2016 picture user2016 · Dec 16, 2015 · Viewed 10.5k times · Source

Trying to run project with Maven using Anypoint Studio IDE.

But I am getting this error in Console:

[ERROR] Failed to execute goal on project magento: Could not resolve dependencies for project com.test:magento:mule:1.0.0-SNAPSHOT: Failed to collect dependencies for [com.mulesoft.muleesb:mule-core-ee:jar:3.7.2 (provided), com.mulesoft.muleesb.modules:mule-module-spring-config-ee:jar:3.7.2 (provided), org.mule.transports:mule-transport-file:jar:3.7.2 (provided), org.mule.transports:mule-transport-http:jar:3.7.2 (provided), com.mulesoft.muleesb.transports:mule-transport-jdbc-ee:jar:3.7.2 (provided), com.mulesoft.muleesb.transports:mule-transport-jms-ee:jar:3.7.2 (provided), org.mule.transports:mule-transport-vm:jar:3.7.2 (provided), org.mule.modules:mule-module-scripting:jar:3.7.2 (provided), org.mule.modules:mule-module-xml:jar:3.7.2 (provided), org.mule.tests:mule-tests-functional:jar:3.7.2 (test), org.mule.modules:mule-module-http:jar:3.7.2 (provided), org.mule.modules:mule-module-magento:jar:2.2.0 (compile), org.mule.modules:mule-module-json:jar:3.7.2 (provided)]: Failed to read artifact descriptor for org.mule.modules:mule-module-validation:jar:3.7.2: Failure to find org.mule.extensions:mule-extensions:pom:3.7.2 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] [ERROR] And this is my pom.xml file:

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

    <mule.version>3.7.2</mule.version>
    <mule.tools.version>1.1</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>
            <inclusions>
                    <inclusion>
                        <groupId>org.mule.modules</groupId>
                        <artifactId>mule-module-magento</artifactId>
                    </inclusion>
                </inclusions>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2.1</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>project</descriptorRef>
                </descriptorRefs>
            </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>
</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-http</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
<dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-magento</artifactId>
        <version>2.2.0</version>
    </dependency>
<dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-json</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>
</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>

Any Ideas? What I'm missing?

Answer

Ashutosh Jindal picture Ashutosh Jindal · Dec 16, 2015

I can see that you have a repository for maven central as well as another for mule plugins.

Try adding the following repositories to the <repositories> ... </repositories>?

   <repository>
       <id>mulesoft-releases</id>
       <name>MuleSoft Releases Repository</name>
       <url>http://repository.mulesoft.org/releases/</url>
       <layout>default</layout>
   </repository>
   <repository>
       <id>mulesoft-snapshots</id>
       <name>MuleSoft Snapshots Repository</name>
       <url>http://repository.mulesoft.org/snapshots/</url>
       <layout>default</layout>
   </repository>

And try the maven build again?

(Use this pom as a reference)