Java org.eclipse.persistence.moxy;2.3.2:解析jersey bundle 1.19.1时未找到
尝试Java org.eclipse.persistence.moxy;2.3.2:解析jersey bundle 1.19.1时未找到,java,maven,ivy,Java,Maven,Ivy,尝试ivy时遇到异常:将jersey bundle 1.19.1模块安装到本地(基于文件系统的)ivy解析器中。我已经设法用下面的代码复制了这一点 失败案例 我在下面的ivysettings.xml中定义了两个解析器。一个是公共的ibiblio解析器,另一个是本地的(基于文件系统的解析器),我想从ibiblio复制模块(及其依赖项): <ivysettings> <settings defaultResolver="public" /> <reso
ivy时遇到异常:将jersey bundle 1.19.1
模块安装到本地(基于文件系统的)ivy解析器中。我已经设法用下面的代码复制了这一点
失败案例
我在下面的ivysettings.xml
中定义了两个解析器。一个是公共的ibiblio
解析器,另一个是本地的(基于文件系统的解析器),我想从ibiblio
复制模块(及其依赖项):
<ivysettings>
<settings defaultResolver="public" />
<resolvers>
<ibiblio name="public" m2compatible="true" />
<filesystem name="fs-local">
<ivy
pattern="/tmp/local-ivy-repo/[organisation]/[module]/ivys/ivy-[revision].xml"/>
<artifact
pattern="/tmp/local-ivy-repo/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
</resolvers>
</ivysettings>
当我执行(使用Ant
)上述文件时,我最终得到以下消息:
:: problems summary ::
:::: WARNINGS
module not found: org.eclipse.persistence#org.eclipse.persistence.moxy;2.3.2
==== public: tried
https://repo1.maven.org/maven2/org/eclipse/persistence/org.eclipse.persistence.moxy/2.3.2/org.eclipse.persistence.moxy-2.3.2.pom
-- artifact org.eclipse.persistence#org.eclipse.persistence.moxy;2.3.2!org.eclipse.persistence.moxy.jar:
https://repo1.maven.org/maven2/org/eclipse/persistence/org.eclipse.persistence.moxy/2.3.2/org.eclipse.persistence.moxy-2.3.2.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.eclipse.persistence#org.eclipse.persistence.moxy;2.3.2: not found
::::::::::::::::::::::::::::::::::::::::::::::
这显然是一个警告,而不是一个错误(不确定这种情况下的区别有多重要)。查看/tmp/local ivy repo/
目录,我看到了许多模块和jar(包括jersey bundle
)
成功案例
另一方面,如果我试图从公共存储库中下拉jersey bundle
依赖项(不使用ivy:install
在本地“安装”它),例如使用以下Ant文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant"
basedir="."
default="retrieve-ivy-deps"
name="foo">
<target name="retrieve-ivy-deps"
description="resolve and retrieve dependencies with ivy">
<ivy:settings file="ivysettings.xml"/>
<ivy:resolve file="ivy.xml"/>
<ivy:retrieve conf="with-transitive"
pattern="ivy-jars/[artifact]-[revision](-[classifier]).[ext]"
sync="true"
type="jar, bundle"/>
</target>
</project>
…和以下常春藤文件:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="foo" module="bar"/>
<configurations>
<conf name="with-transitive" description="IVY jars with transitive dependencies"/>
</configurations>
<dependencies>
<dependency org="com.sun.jersey" name="jersey-bundle" rev="1.19.1" conf="with-transitive->default"/>
</dependencies>
</ivy-module>
…然后,我没有看到任何错误或警告,在操作结束时,我在ivy jars
目录中看到两个文件:jersey-bundle-1.19.1.jar
和jsr311-api-1.1.1.jar
我的问题是:
在失败案例中,警告信息的含义和意义是什么?我如何处理它
为什么Ant/Ivy能够从ibiblio
模块jersey bundle 1.19.1
及其所有可传递的依赖项中提取而不失败,但不能Ivy:install
它?换句话说,为什么成功的案例成功,而失败的案例失败?
在成功的情况下,在相应的Ivy文件中,我请求模块及其所有可传递的依赖项(因为我使用的是默认值配置:
)。但只有2个jar被下载。与之相反,当我查看ivy-1.19.1.xml时,我看到了大约20个依赖项,即使在失败的情况下,当我查看/tmp/local ivy repo/
目录时,我看到了所有依赖项(除了moxy 2.3.2
)。为什么会出现这种差异
对安装任务使用如下配置:
<ivy:install organisation="com.sun.jersey" ... conf="compile"/>
编译文件
ivysettings.xml
如果我没有弄错,你实际上是在说提供的jersey bundle
模块的配置(定义见ivy.xml
)是错误的,唯一的解决方法是只在本地常春藤存储库中安装编译模块的配置。我不是一个常春藤专家,但我希望有一个设施,允许客户端程序员覆盖模块中声明的依赖项。我认为这就是overrides
在ivy.xml
文件中要做的事情,但显然它不能与安装任务一起使用。我遗漏了什么吗?
<ivy:install organisation="com.sun.jersey" ... conf="compile"/>
├── build.xml
├── ivysettings.xml
└── local-ivy-repo
├── com.sun.jersey
│ └── jersey-bundle
│ └── ivys
│ ├── ivy-1.19.1.xml
│ ├── ivy-1.19.1.xml.md5
│ └── ivy-1.19.1.xml.sha1
└── javax.ws.rs
└── jsr311-api
├── ivys
│ ├── ivy-1.1.1.xml
│ ├── ivy-1.1.1.xml.md5
│ └── ivy-1.1.1.xml.sha1
└── jars
├── jsr311-api-1.1.1.jar
├── jsr311-api-1.1.1.jar.md5
└── jsr311-api-1.1.1.jar.sha1
<project name="demo" default="build" xmlns:ivy="antlib:org.apache.ivy.ant">
<target name="build">
<ivy:install organisation="com.sun.jersey"
module="jersey-bundle"
revision="1.19.1"
from="public"
to="fs-local"
transitive="true"
overwrite="true"
conf="compile"/>
</target>
</project>
<ivysettings>
<settings defaultResolver="public" />
<resolvers>
<ibiblio name="public" m2compatible="true" />
<filesystem name="fs-local">
<ivy pattern="${ivy.settings.dir}/local-ivy-repo/[organisation]/[module]/ivys/ivy-[revision].xml"/>
<artifact pattern="${ivy.settings.dir}/local-ivy-repo/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
</resolvers>
</ivysettings>