Gradle trying to unzip a pom typed dependency

送分小仙女□ 提交于 2020-01-14 14:42:49

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/32361545/gradle-trying-to-unzip-a-pom-typed-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!