winghc/hadoop2x-eclipse-plugin

Obtain source ivy-2.1.0.jar failed, java.util.zip.ZipException: error in opening zip file

Opened this issue · 4 comments

Buildfile: /home/github/hadoop2x-eclipse-plugin/src/contrib/eclipse-plugin/build.xml

check-contrib:
[echo] eclipse.home unset: skipping eclipse plugin

init:

ivy-download:
[get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar
[get] To: /home/github/hadoop2x-eclipse-plugin/ivy/ivy-2.1.0.jar
[get] Not modified - so not downloaded

ivy-probe-antlib:

ivy-init-antlib:
Unable to obtain resource from /home/github/hadoop2x-eclipse-plugin/ivy/ivy-2.1.0.jar: java.util.zip.ZipException: error in opening zip file
[typedef] Unable to obtain resource from /home/github/hadoop2x-eclipse-plugin/ivy/ivy-2.1.0.jar:
[typedef] java.util.zip.ZipException: error in opening zip file
[typedef] at java.util.zip.ZipFile.open(Native Method)
[typedef] at java.util.zip.ZipFile.(ZipFile.java:215)
[typedef] at java.util.zip.ZipFile.(ZipFile.java:145)
[typedef] at java.util.jar.JarFile.(JarFile.java:153)
[typedef] at java.util.jar.JarFile.(JarFile.java:117)
[typedef] at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1002)
[typedef] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:145)
[typedef] at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.(AntClassLoader.java:109)
[typedef] at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:949)
[typedef] at org.apache.tools.ant.AntClassLoader.getNamedResources(AntClassLoader.java:918)
[typedef] at org.apache.tools.ant.loader.AntClassLoader5.getResources(AntClassLoader5.java:56)
[typedef] at org.apache.tools.ant.taskdefs.Definer.resourceToURLs(Definer.java:375)
[typedef] at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:267)
[typedef] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[typedef] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[typedef] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[typedef] at java.lang.reflect.Method.invoke(Method.java:606)
[typedef] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[typedef] at org.apache.tools.ant.Task.perform(Task.java:348)
[typedef] at org.apache.tools.ant.Target.execute(Target.java:390)
[typedef] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[typedef] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[typedef] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[typedef] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[typedef] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[typedef] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[typedef] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[typedef] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[typedef] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[typedef] Could not load definitions from resource org/apache/ivy/ant/antlib.xml. It could not be found.

BUILD FAILED
/home/github/hadoop2x-eclipse-plugin/src/contrib/build-contrib.xml:476: You need Apache Ivy 2.0 or later from http://ant.apache.org/
It could not be loaded from http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar

Total time: 1 second

Delete the /home/github/hadoop2x-eclipse-plugin/ivy/ivy-2.1.0.jar on you disk.
And run the script again, make sure you network is OK.

Still can't generate the plugin, I think it is because the link for ivy-2.1.0.jar is not very stable. Can we generate the plugin and put it on github for some else to use.

Solution 1:
You can download ivy-2.1.0.jar by yourself.
website:
http://archive.apache.org/dist/ant/ivy/2.1.0/
And then extract the ivy-2.1.0.jar from the tar of apache-ivy-2.1.0-bin.tar.gz .
Copy the ivy-2.1.0.jar to the path /home/github/hadoop2x-eclipse-plugin/ivy/ivy-2.1.0.jar.
Try it again.

Solution 2:
You can also overwrite the hadoop2x-eclipse-plugin-master/src/contrib/build-contrib.xml file.
Find the target of ivy-download, ivy-init-antlib:
Comment it.
Modify the code like this:

![ivy](https://f.cloud.github.com/assets/5138883/1750168/68f69f84-6573-11e3-99c8-79ce3785e417.png)

Copy the ivy-2.1.0.jar jar to the path of hadoop2.x
${hadoop2.x.root}/share/hadoop/common/
Run the script again.

I have tried both solutions without success, it once said success, but without generating the plugin, I have tried several times still without success, it reports the error You need Apache Ivy2.0 or later..., I now have downloaded the plugin from your blog, I hope you could pull your code here to fix the problem.