在Mule

时间:2016-03-16 17:33:44

标签: java maven redis mule

由于问题报告为here,我在非maven mule项目中使用了 3.3.1 连接器版本并且运行良好。

但是,我想在maven mule项目中添加redis。但是,redis docs只为我提供了两个选项:ReleaseLatest版本。两者都导致报告问题above

我尝试将版本更改为 3.3.1 3.3.2 但是当我尝试启动项目时,出现以下错误:

  

无法在项目单点登录上执行目标:无法解析项目br.com.xpto的依赖关系:单点登录:mule:1.0.0-SNAPSHOT:无法在org.mule中收集依赖项。模块:mule-module-redis:jar:3.3.2 - > org.mule.tools.devkit:mule-devkit-annotations:jar:3.3.1 - > org.mule.modules:mule-module-annotations:jar:3.3.0 - > org.mule:mule-core:jar:3.3.0 - > javax.activation:activation:jar:1.1-osgi:无法读取javax.activation的工件描述符:activation:jar:1.1-osgi:无法传输工件javax.activation:activation:pom:1.1-osgi from / to codehaus- snaphosts(http://snapshots.repository.codehaus.org/):snapshots.repository.codehaus.org

问题:有没有人知道如何在没有发布或最新版本的情况下为maven项目添加redis依赖项?

更新

为了帮助你们理解我的问题,我将在下面添加我的pom.xml

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

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

    <mule.version>3.7.0</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>
            </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>
        <plugin>
            <groupId>org.mule.tools</groupId>
            <artifactId>maven-mule-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <excludeMuleDependencies>false</excludeMuleDependencies>
                <inclusions>
                    <inclusion>
                        <groupId>org.mule.modules</groupId>
                        <artifactId>mule-module-redis</artifactId>
                    </inclusion>
                </inclusions>
            </configuration>
        </plugin>
    </plugins>
</build>

<!-- Mule Dependencies -->
<dependencies>
    <!-- Xml configuration -->
    <dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-spring-config</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>org.mule.transports</groupId>
        <artifactId>mule-transport-jdbc</artifactId>
        <version>${mule.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.mule.transports</groupId>
        <artifactId>mule-transport-jms</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-redis</artifactId>
        <version>3.3.2</version>
    </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>
    <repository>
        <id>mulesoft-snapshots</id>
        <name>MuleSoft Snapshot Repository</name>
        <url>http://repository.mulesoft.org/snapshots/</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>

所以上面pom.xml的关键点是:

1 - 存储库

    <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 Snapshot Repository</name>
        <url>http://repository.mulesoft.org/snapshots/</url>
        <layout>default</layout>
    </repository>

2 - 依赖

    <dependency>
        <groupId>org.mule.modules</groupId>
        <artifactId>mule-module-redis</artifactId>
        <version>3.3.2</version>
    </dependency>

当我尝试启动应用程序时,出现以下错误

  

建立失败   [错误]无法在项目xpto上执行目标:无法解决   项目com.mycompany的依赖项:xpto:mule:1.0.0-SNAPSHOT:   无法在org.mule.modules上收集依赖项:mule-module-redis:jar:3.3.2 - &gt;   org.mule.tools.devkit:mule-devkit-annotations:jar:3.3.1 - &gt;   org.mule.modules:mule-module-annotations:jar:3.3.0 - &gt; org.mule:骡子核心:罐子:3.3.0    - &GT; javax.activation:activation:jar:1.1-osgi:无法读取工件描述符   javax.activation:activation:jar:1.1-osgi:无法传输工件   javax.activation:activation:pom:1.1-osgi from / to codehaus-snaphosts(http://snapshots.repository.codehaus.org/):   snapshots.repository.codehaus.org - &gt; [帮助1]

更新2

执行命令 mvn dependency:tree -Dincludes = javax.activation 我得到以下输出:

  

正在下载:http://snapshots.repository.codehaus.org/org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/1.1-osgi/geronimo-j2ee-connector_1.5_spec-1.1-osgi.pom   正在下载:http://repository.codehaus.org/org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/1.1-osgi/geronimo-j2ee-connector_1.5_spec-1.1-osgi.pom   正在下载:http://repository.codehaus.org/org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/1.1-osgi/geronimo-j2ee-connector_1.5_spec-1.1-osgi.pom   建立失败   [错误]无法在项目xpto上执行目标:无法解析项目com.mycompany的依赖项:xpto:mule:1.0.0-SNAPSHOT:无法在org.mule.modules上收集依赖项:mule-module-redis:jar: 3.3.2 - &gt; org.mule.tools.devkit:mule-devkit-annotations:jar:3.3.1 - &gt; org.mule.modules:mule-module-annotations:jar:3.3.0 - &gt; org.mule:mule-core:jar:3.3.0 - &gt; org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:jar:1.1-osgi:无法读取org.apache.geronimo.specs的工件描述符:geronimo-j2ee-connector_1.5_spec:jar:1.1-osgi:无法传输工件org.apache.geronimo.specs:geronimo-j2ee-connector_1.5_spec:pom:1.1-osgi from / to codehaus-snaphosts(http://snapshots.repository.codehaus.org/):snapshots.repository.codehaus.org - &gt; [帮助1]

1 个答案:

答案 0 :(得分:1)

将以下存储库添加到您的pom中,以便找到javax/activation/activation/1.1-osgi

   <repository>
    <id>codehaus-mule-repo</id>
    <name>codehaus-mule-repo</name>
    <url>
        https://repository.mulesoft.org/nexus/content/groups/public/
    </url>
    <layout>default</layout>
  </repository>