Gradle尝试解压缩一个pom类型的依赖项 [英] Gradle trying to unzip a pom typed dependency

查看:548
本文介绍了Gradle尝试解压缩一个pom类型的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个项目中,我依赖于在 build.gradle 中指定的Java矩阵库MTJ:

 依赖关系{
...
编译'com.googlecode.matrix-toolkits-java:mtj:1.0.4'
...
}

MTJ依次取决于netlib,更具体的说就是相当于明确地在上面加入了'com.github.fommil.netlib:all:1.1.2'

当我运行gradle构建。我得到以下错误:

 无法展开ZIP'/Users/valentin/.gradle/caches/modules-2/files -2.1 / com.github.fommil.netlib /所有/ 1.1.2 / f235011206ac009adad2d6607f222649aba5ca9e /全1.1.2.pom。 
存档不是ZIP存档。

因此,不知怎的,gradle会感到困惑,并且认为该文件只是一个zip文件,指向其他依赖项。



任何人都有修复或知道解决方法吗? div>

请查看此处。您指定的依赖项是类型 pom - maven中的此类型用于聚合项目。 Gradle下载它,尝试解压缩并失败。看起来这不是你想要的。
此处可以找到其他工件对于组: com.github.fommil.netlib 。请找到您要查找的jar并直接指定依赖项。


In a project of mine I have a dependency on a java matrix library MTJ which I specify like this in build.gradle:

dependencies {
  ...
  compile 'com.googlecode.matrix-toolkits-java:mtj:1.0.4'
  ...
}

MTJ in turns depends on netlib, more concretely it would be the equivalent of explicitly adding compile 'com.github.fommil.netlib:all:1.1.2' above.

When I run the gradle build. I get the following error:

Could not expand ZIP '/Users/valentin/.gradle/caches/modules-2/files-2.1/com.github.fommil.netlib/all/1.1.2/f235011206ac009adad2d6607f222649aba5ca9e/all-1.1.2.pom'. 
archive is not a ZIP archive.

So somehow gradle is confused and treats the file as been a zip file when it is just a pom that points to other dependencies.

Anyone has a fix or knows of a workaround?

解决方案

Please have a look here. The dependency you specified is of type pom - this type in maven is used to aggregate projects. Gradle downloads it, tries to unzip and fail. It seems that this is not what you're looking for. Here you can find other artifacts for group: com.github.fommil.netlib. Please find a jar you're looking for and specify the dependency directly.

这篇关于Gradle尝试解压缩一个pom类型的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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