常春藤-无法下载,因为POM文件和JAR文件名不匹配 [英] Ivy - Can't download because POM file and the JAR file name aren't matching patterns

查看:52
本文介绍了常春藤-无法下载,因为POM文件和JAR文件名不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

再次通过IVY.

现在的问题是将常春藤文件POM文件存储到JSON库中:

The problem now is that the ivy file the POM file to the JSON library is called:

http: //repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.pom

json-lib-2.4.pom

json-lib-2.4.pom

但JAR文件名为:

json-lib-2.4-jdk13.jar

json-lib-2.4-jdk13.jar

-jdk13使其无法找到pom文件.

The -jdk13 makes it so that the pom file cannot be found.

Ergo它无法下载JAR文件,因为它显示以下内容:

Ergo it can't download the JAR file because it says this:

== resolving dependencies egencia#com.egencia.test.framework;working@ESFVMVI-750->net.sf.json-lib#json-lib;2.4 [default->compile]
[ivy:resolve]       tried http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk13.jar
[ivy:resolve]   maven: no ivy file found for net.sf.json-lib#json-lib;2.4: using default data
[ivy:resolve]   found net.sf.json-lib#json-lib;2.4 in maven

现在..我设法放置一个可以找到JAR文件的模式,并在其中添加-jdk13.但是通过这种方式,不再找到POM文件.

Now.. I managed to put a pattern in which finds the JAR file, adding the -jdk13 to it.. But this way the POM file is no longer found.

此后,没有下载的JAR文件,并且由于缺少dep,构建当然会失败.

After that, there is no downloaded JAR file and of course the build failes because of the missing dep.

那么...我可以以某种方式将POM配置为JAR文件名吗?

So... can I somehow configure the POM to be something else as the JAR files name?

谢谢!

推荐答案

在Maven中称为分类器属性.尝试如下声明您的依赖项:

It's called a classifier attribute in Maven. Try declaring your dependency as follows:

<ivy-module version='2.0' xmlns:m="http://ant.apache.org/ivy/maven">
    ..
    <dependencies>
        ..
        <dependency org="net.sf.json-lib" name="json-lib" rev="2.4"> 
            <artifact name="json-lib" type="jar" m:classifier="jdk13"/>
        </dependency>
        ..
    </dependencies>
</ivy-module>

这将从Maven模块中检索关联的工件,而不是默认的主工件.

This will retrieve the associated artifact rather than the default primary artifact from the Maven module.

此常春藤依赖声明在功能上与Maven中的以下内容相同

This ivy dependency declaration is functionally the same as the following in Maven

<dependency>
  <groupId>net.sf.json-lib</groupId>
  <artifactId>json-lib</artifactId>
  <version>2.4</version>
  <classifier>jdk13</classifier>
</dependency>

这篇关于常春藤-无法下载,因为POM文件和JAR文件名不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆