【问题标题】:Mule - Project build failed when running with mavenMule - 使用 maven 运行时项目构建失败
【发布时间】:2017-09-09 16:42:15
【问题描述】:

我在尝试运行 Hello World Mulesoft 项目时遇到了失败,它看起来与我正在运行的 Mulesoft 版本有关,我在 Google 上四处搜索,但无法获得任何信息来帮助解决此问题,这里是构建错误:

[10:01:21] Running: mvn clean package -DskipMunitTests
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building Mule firsttest Application 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.mulesoft.muleesb:mule-core-ee:jar:3.8.4 is missing, no dependency information available
[WARNING] The POM for com.mulesoft.muleesb.modules:mule-module-spring-config-ee:jar:3.8.4 is missing, no dependency information available
[WARNING] The POM for com.mulesoft.muleesb.transports:mule-transport-jdbc-ee:jar:3.8.4 is missing, no dependency information available
[WARNING] The POM for com.mulesoft.muleesb.transports:mule-transport-jms-ee:jar:3.8.4 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.496 s
[INFO] Finished at: 2017-08-31T10:01:27-05:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "compiler" could not be activated because it does not exist.
[ERROR] Failed to execute goal on project firsttest: Could not resolve dependencies for project com.schwab:firsttest:mule:1.0.0-SNAPSHOT: Failed to collect dependencies at org.mule.transports:mule-transport-file:jar:3.8.4: Failed to read artifact descriptor for org.mule.transports:mule-transport-file:jar:3.8.4: Failure to find org.mule.transports:mule-transports:pom:3.8.4 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] 
[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:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

这里是 POM 文件:

<?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.schwab</groupId>
    <artifactId>firsttest</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>mule</packaging>
    <name>Mule firsttest Application</name>

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

        <mule.version>3.8.4</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-http</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
        </dependency>
    <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-module-spring-config</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>

</project>

知道发生了什么吗?

感谢您的帮助。

【问题讨论】:

  • 其他详细信息:Apache Maven 3.5.0 Maven 主页:C:\MuleSoftwares\apache-maven-3.5.0\bin\.. Java 版本:1.8.0_144,供应商:Oracle Corporation Java 主页: C:\Program Files\Java\jdk1.8.0_144\jre 默认语言环境:en_US,平台编码:Cp1252 操作系统名称:“windows 8.1”,版本:“6.3”,arch:“amd64”,家族:“windows”跨度>

标签: java maven mule


【解决方案1】:

Maven 无法找到 transports:mule-transport-file:jar:3.8.4,因为它在您的 pom 中配置的 &lt;repositories&gt; 下的 Mule Maven 存储库中不可用。这是 Public Mule 存储库,但似乎 3.8.4 运行时及其依赖项并未公开,可能仅适用于企业用户。你可以通过浏览存储库自己查看,缺少 JAR:https://repository-master.mulesoft.org/nexus/content/repositories/releases/org/mule/transports/mule-transport-file/3.8.4

您可以使用依赖项可用的 Mule 3.8.1(在您的 pom 中更改 Mule 版本)或配置企业 (EE) 存储库(如果您有适当的许可和访问权限)(请参阅https://docs.mulesoft.com/mule-user-guide/v/3.8/configuring-maven-to-work-with-mule-esb

*不相关说明:您似乎在 Studio 中运行 Mule EE。 Studio 提供 EE 运行时用于测试目的,因此 Maven 不会(过多地)抱怨缺少 EE 依赖项,但是如果您尝试在 Studio 之外运行 Mule EE,则需要配置 EE 存储库。 *

【讨论】:

【解决方案2】:

使用代理详细信息更新 Setting.xml,如果您从组织网络尝试,似乎无法下载所有 jars

【讨论】:

  • 代理问题是当我尝试使用Mule安装时,此时没有maven,我重新启动了我的Mule 2次并且我能够下载运行时,我的代理有问题(防火墙)在我的公司。当我尝试再次安装时,它再次出现代理错误,我可能需要与代理团队中的某个人交谈以了解发生了什么。
【解决方案3】:

我假设这是您的第一个项目。您可以禁用 Maven 以体验 MULE 行为。右键单击该项目,它提供了一个禁用 Maven 的选项。之后你就可以运行你的项目了。

【讨论】:

  • 没错,我的第一个 Mule 项目,maven 被禁用,我在尝试仅通过 Mule 安装时遇到错误。看我上面的回复..
猜你喜欢
  • 1970-01-01
  • 2022-08-10
  • 1970-01-01
  • 2015-05-10
  • 2020-10-28
  • 1970-01-01
  • 2016-10-19
  • 2020-10-21
  • 1970-01-01
相关资源
最近更新 更多