AnsweredAssumed Answered

How do I get PigUnit working?

Question asked by spettinato on Jan 7, 2014
Latest reply on Jan 15, 2014 by snayeem
Hi,

I attempted to run PigUnit tests in Eclipse but did not have the PigUnit jar file.  I attempted to build it, and decided to use the jar file available [here](http://repository.mapr.com/nexus/content/repositories/mapr-public/org/apache/pig/pigunit/0.11.2-mapr/).  But there are further issues.

I am getting a failure that is well documented [here](http://mail-archives.apache.org/mod_mbox/pig-user/201210.mbox/%3CCAO8ATY17FSCkWxvTLMbGWLqXkncsZ+4Ob+NXKFZLnLQWWjvU9Q@mail.gmail.com%3E01210.mbox/%3CCAO8ATY17FSCkWxvTLMbGWLqXkncsZ+4Ob+NXKFZLnLQWWjvU9Q@mail.gmail.com%3E) but I can't use the documented solution.

Essentially I can't run my PigUnit Tests because of a "java.lang.NoSuchMethodError:".  The solution is to rebuild pig-0.10.0-withouthadoop.jar in the pig directory via the following command.

> ant clean jar-withouthadoop -Dhadoopversion=23

The problem is that this command fails, it's missing /${user.home}/.ivy2/ivy-settings-public.xml.  I have tried to build this file from scratch, but I don't know what it should contain.

#An answer to any of these questions would be helpful.
##How do I run MapR PigUnit tests?
##How do I build MapR Pig Jar files from their source?
##What goes into /${user.home}/.ivy2/ivysettings-public.xml

#Original Failure

Buildfile: build.xml

clean-piggybank:

clean:

clean:
   [delete] Deleting directory /opt/mapr/pig/pig-0.11/build

clean:

clean:

ivy-download:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
      [get] To: /opt/mapr/pig/pig-0.11/ivy/ivy-2.2.0.jar
      [get] Not modified - so not downloaded

ivy-init-dirs:
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy/lib
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy/report
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy/maven

ivy-probe-antlib:

ivy-init-antlib:

ivy-init:
[ivy:configure] impossible to define new type: class not found: org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator in [] nor Ivy classloader
[ivy:configure] :: Apache Ivy 2.3.0-local-20131108183505 - 20131108183505 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /opt/mapr/pig/pig-0.11/ivy/ivysettings.xml

BUILD FAILED
/opt/mapr/pig/pig-0.11/build.xml:1771: impossible to configure ivy:settings with given file: /opt/mapr/pig/pig-0.11/ivy/ivysettings.xml : java.text.ParseException: failed to load settings from file:/opt/mapr/pig/pig-0.11/ivy/ivysettings.xml: io problem while parsing config file: /root/.ivy2/ivysettings-public.xml (No such file or directory)

Total time: 1 second

#Failure using /${user.home}/.ivy2/ivysettings-public.xml equal to
##Specifically I'm using the file /root/.ivy2/ivysettings-public.xml that I built from scratch.  I would copy/paste the file contents here, but the right angle bracket will not appear properly in Markdown.  The file I built contains an open XML tag ivysettings closed XML tag ivysettings.

Buildfile: build.xml

clean-piggybank:

clean:

clean:
   [delete] Deleting directory /opt/mapr/pig/pig-0.11/build

clean:

clean:

ivy-download:
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.jar
      [get] To: /opt/mapr/pig/pig-0.11/ivy/ivy-2.2.0.jar
      [get] Not modified - so not downloaded

ivy-init-dirs:
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy/lib
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy/report
    [mkdir] Created dir: /opt/mapr/pig/pig-0.11/build/ivy/maven

ivy-probe-antlib:

ivy-init-antlib:

ivy-init:
[ivy:configure] impossible to define new type: class not found: org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator in [] nor Ivy classloader
[ivy:configure] :: Apache Ivy 2.3.0-local-20131108183505 - 20131108183505 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = /opt/mapr/pig/pig-0.11/ivy/ivysettings.xml

BUILD FAILED
/opt/mapr/pig/pig-0.11/build.xml:1771: impossible to configure ivy:settings with given file: /opt/mapr/pig/pig-0.11/ivy/ivysettings.xml : java.text.ParseException: failed to load settings from file:/opt/mapr/pig/pig-0.11/ivy/ivysettings.xml: unknown resolver mapr-central: resolver should be defined before being referenced



Outcomes