如何下载中心在常青藤多个Maven依赖有不同的分类

如何下载中心在常青藤多个Maven依赖有不同的分类

本文介绍了如何下载中心在常青藤多个Maven依赖有不同的分类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图依靠 Neo4j的服务器罐子和 Neo4j的服务器罐子 - 常春藤静态web.jar 。我试图像

I am trying to depend on Neo4j server jar and Neo4j server jar - static-web.jar in Ivy. I am trying something like

<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="org.jimwebber" module="neo4j-koans"/>
<dependencies>
    <dependency org="org.springframework.data" name="spring-data-neo4j" rev="1.0.0.RELEASE">
        <exclude module="jms"/>
        <exclude module="jmxtools"/>
        <exclude module="jmxri"/>
        <exclude org="org.slf4j" name="slf4j-log4j12"/>
    </dependency>
    <dependency org="org.aspectj" name="aspectjrt" rev="1.6.11.RELEASE"/>
    <dependency org="org.aspectj" name="aspectjtools" rev="1.6.11.RELEASE"/>
    <dependency org="org.neo4j.app" name="neo4j-server" rev="1.5-SNAPSHOT" m:classifier="static-web"/>
    <dependency org="org.neo4j.app" name="neo4j-server" rev="1.5-SNAPSHOT"/>
    <dependency org="org.neo4j" name="neo4j-community" rev="1.5-SNAPSHOT"/>
    <dependency org="org.neo4j" name="neo4j-shell" rev="1.5-SNAPSHOT"/>
    <dependency org="org.codehaus.jackson" name="jackson-core-asl" rev="1.7.5"/>
    <dependency org="org.codehaus.jackson" name="jackson-mapper-asl" rev="1.7.5"/>
    <dependency org="com.sun.jersey" name="jersey-client" rev="1.3"/>
    <dependency org="org.mockito" name="mockito-all" rev="1.8.5"/>
    <dependency org="junit" name="junit" rev="4.7"/>
</dependencies>
</ivy-module>

但我从来没有得到staic-网.JAR下来,现在不是错误。任何人都知道如何做到这一点?

But I never get the "staic-web".jar down, and now error either. Anyone knows how to do this?

感谢您的任何提示!

/彼得

推荐答案

这是你如何检索与一个Maven模块上有多个神器:

This is how you retrieve more than one artifact associated with a Maven module:

<dependency org="org.neo4j.app" name="neo4j-server" rev="1.5-SNAPSHOT">
    <artifact name="neo4j-server" type="jar" />
    <artifact name="neo4j-server" type="jar" m:classifier="static-web"/>
</dependency>

的语法是因为使用Maven的分类参考额外的构件的方式有点奇怪。

The syntax is odd because of the way Maven references additional artifacts using classifiers.

在Neo4j的快照库需要被添加到您的 ivysettings.xml 文件(快照版本不会发布到Maven的中央)

The neo4j snapshot repository needs to be added into your ivysettings.xml file (snapshot releases are not published to Maven Central)

<ivysettings>
    <settings defaultResolver="chain"/>
    <resolvers>
        <chain name="chain">
            <ibiblio name="central" m2compatible="true"/>
            <ibiblio name="neo4j-snapshot" m2compatible="true" root="http://repo.neo4j.org/content/repositories/snapshots"/>
        </chain>
    </resolvers>
</ivysettings>

其它问题

版本修正

<dependency org="org.aspectj" name="aspectjrt" rev="1.6.11"/>
<dependency org="org.aspectj" name="aspectjtools" rev="1.6.11"/>

破库POM

使用快照回购的问题是有时多金属氧酸盐被打破。常春藤无法处理以下文件:

Broken repository POM

The problem with using snapshot repos is sometimes the POMs are broken. Ivy is unable to process the following file:

http://repo.neo4j.org/content/repositories/snapshots/org/neo4j/app/neo4j-server/1.5-SNAPSHOT/neo4j-server-1.5-SNAPSHOT.pom

这prevents从下载的Neo4j服务器arifacts常春藤....

This prevents ivy from downloading the neo4j-server arifacts....

[ivy:retrieve] :::: WARNINGS
[ivy:retrieve]  io problem while parsing ivy file: http://repo.neo4j.org/content/repositories/snapshots/org/neo4j/app/neo4j-server/1.5-SNAPSHOT/neo4j-server-1.5-SNAPSHOT.pom: Impossible to load parent for file:/home/mark/.ivy2/cache/org.neo4j.app/neo4j-server/ivy-1.5-SNAPSHOT.xml.original. Parent=org.neo4j.build#parent-pom;25
[ivy:retrieve]      module not found: org.neo4j.app#neo4j-server;1.5-SNAPSHOT
..
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      ::          UNRESOLVED DEPENDENCIES         ::
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      :: org.neo4j.app#neo4j-server;1.5-SNAPSHOT: not found
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::

的变通

在设置文件中配置常春藤检索工件直接使用被用于所有其它模块的多金属氧酸盐是有效的。

Work-around

In the settings file configure ivy to retrieve the artifacts directly using the url resolver. The ibiblio resolver is used for all other modules whose POMs are valid.

<ivysettings>
    <settings defaultResolver="chain"/>
    <resolvers>
        <chain name="chain">
            <ibiblio name="central" m2compatible="true"/>
            <ibiblio name="neo4j-snapshot" m2compatible="true" root="http://repo.neo4j.org/content/repositories/snapshots"/>
        </chain>
        <url name="neo4j-snapshot-hack">
              <artifact pattern="http://repo.neo4j.org/content/repositories/snapshots/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
        </url>
    </resolvers>
    <modules>
        <module organisation="org.neo4j.app" name="neo4j-server" resolver="neo4j-snapshot-hack"/>
    </modules>
</ivysettings>

这将意味着在绕过POM文件传递依赖可能会被跳过。没法子,如果POM不能正常工作

This will mean transitive dependencies in the by-passed POM file might be skipped. Can't be helped if the POM is not working properly

这篇关于如何下载中心在常青藤多个Maven依赖有不同的分类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 18:30