Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile Pig-0.13.0

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to compile Pig-0.13.0 for you. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

1. Download pig to the local directory and run ant.

[wukong@bd23 pig-0.13.0] $ant clean jar-withouthadoop-Dhadoopversion=23Buildfile: build.xmlBUILD FAILED/home/wukong/usr/pig-0.13.0/build.xml:750: Problem: failed to create task or type scriptdefCause: the class org.apache.tools.ant.taskdefs.optional.script.ScriptDef was not found. This looks like one of Ant's optional components.Action: Check that the appropriate optional JAR exists in-/ usr/share/ant/lib-/ home/wukong/.ant/lib-a directory added on the command line with the-lib argumentDo not panic, this is a common problem.The commonest cause is a missing JAR.This is not a bug; it is a configuration problemTotal time: 1 second

2. The reason for the failure is that the ant included in centos is not fully functional (for more information on ant errors in this step, please see the installation process record of pig tools in Hadoop cluster). The solution is to install the latest version of ant yourself (ant-1.9.4 is installed here) and configure the environment variables. The following is the reference configuration method

[wukong@bd23 apache-ant-1.9.4] $pwd/usr/local/apache-ant-1.9.4 [wukong@bd23 apache-ant-1.9.4] $vim / etc/profile.export JAVA_HOME=/usr/local/jdk1.7.0_65export ANT_HOME=/usr/local/apache-ant-1.9.4export MAVEN_HOME=/usr/local/apache-maven-3.2.2export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/ Lib/dt.jar:$JAVA_HOME/libexport PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH

3. After installing the configuration and source configuration file, run ant again. After about a set of pancake fruit and a bowl of tofu pudding, the operation is basically over. And then you'll find that it's still wrong.

[wukong@bd23 pig-0.13.0] $ant clean jar-withouthadoop-Dhadoopversion=23. [ivy:resolve] http://repository.jboss.com/nexus/content/groups/public/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.zip[ivy:resolve] = apache-snapshots: tried [ivy:resolve] http://repository.apache.org/content/groups/snapshots-group/org/mortbay/jetty/jetty/6.1.26/jetty-6.1.26.zip[ivy:resolve]: : [ivy:resolve]:: UNRESOLVED DEPENDENCIES:: [ivy:resolve]:: : [ivy:resolve]:: com.sun.jersey#jersey-bundle Not found [ivy:resolve]:: com.sun.jersey#jersey-server;1.8: not found [ivy:resolve]:: com.sun.jersey.contribs#jersey-guice;1.8: configuration not found in com.sun.jersey.contribs#jersey-guice;1.8: 'master'. It was required from org.apache.pig#pig 0.13.1-SNAPSHOT hadoop23 [ivy:resolve]: [ivy:resolve]: :: [ivy:resolve]:: FAILED DOWNLOADS:: [ivy:resolve]:: ^ see resolution messages for details ^:: [ivy:resolve]: [ivy:resolve]:: org.mortbay.jetty#jetty 6.1.26 roomjetty.zip [ivy:resolve]: [ivy:resolve]: ERRORS [ivy:resolve] SERVER ERROR: Connection timed out url= http://repo2.maven.org/maven2/xmlenc/xmlenc/0.52/xmlenc-0.52-sources.jar[ivy : resolve] SERVER ERROR: Connection timed out url= http://repo2.maven.org/maven2/xmlenc/xmlenc/0.52/xmlenc-0.52-src.jar[ivy:resolve] SERVER ERROR: Connection timed out url= http://repo2.maven.org/maven2/xmlenc/xmlenc/0.52/xmlenc-0.52-javadoc.jar[ivy:resolve] SERVER ERROR: Connection timed out url= http://repo2.maven.org/maven2/com/sun/jersey/jersey-bundle/1.8/jersey- Bundle-1.8.pom [ivy:resolve] SERVER ERROR: Connection timed out url= http://repo2.maven.org/maven2/com/sun/jersey/jersey-bundle/1.8/jersey-bundle-1.8.jar[ivy:resolve] SERVER ERROR: Backend is unhealthy url= http://repo2.maven.org/maven2/com/sun/jersey/jersey-server/1.8/jersey-server-1.8.pom[ivy:resolve] SERVER ERROR: Connection timed out url= http://repo2.maven .org / maven2/com/sun/jersey/jersey-server/1.8/jersey-server-1.8.jar [ivy:resolve] SERVER ERROR: Connection timed out url= http://repo2.maven.org/maven2/com/sun/jersey/contribs/jersey-guice/1.8/jersey-guice-1.8.pom[ivy:resolve] [ivy:resolve]:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILSBUILD FAILED/home/wukong/usr/pig-0.13.0/build.xml: 1599: impossible to resolve dependencies: resolve failed-see output for detailsTotal time: 13 minutes 25 seconds

4. The reason for the above problems is the failure to download jersey-1.8 and jetty-6.1.26. So download and import maven. The import command is as follows

Path of mvn install:install-file-Dfile= external package\-groupId of DgroupId= external package\-artifactId of DartifactId= external package\-version number of Dversion= external package\-Dpackaging=jar [wukong@bd23 pig-0.13.0] $mvn install:install-file-Dfile=/ Home/wukong/res/jersey-archive-1.18.zip-DgroupId=com.sun.jersey-DartifactId=jersey-core-Dversion=1.8-Dpackaging=zip [wukong@bd23 pig-0.13.0] $mvn install:install-file-Dfile=/home/wukong/res/jetty-6.1.26.zip-DgroupId=org.mortbay.jetty-DartifactId=jetty-Dversion=6.1.26-Dpackaging=zip

5. Compile again after import, but it still doesn't work. What a muddy horse.

[ivy:resolve]:: problems summary:: [ivy:resolve]: WARNINGS [ivy:resolve]: [ivy:resolve]:: UNRESOLVED DEPENDENCIES:: [ivy:resolve]: : [ivy:resolve]:: com.sun.jersey.contribs#jersey-guice Configuration not found in com.sun.jersey.contribs#jersey-guice;1.8: 'master'. It was required from org.apache.pig#pig 0.13.1-SNAPSHOT hadoop23 [ivy:resolve]: [ivy:resolve] [ivy:resolve]:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILSBUILD FAILED/home/wukong/usr/pig-0.13.0/build.xml:1599: impossible to resolve dependencies: resolve failed-see output for details

6. Then install jersey-guice-1.8 in maven

[wukong@bd23 pig-0.13.0] $mvn install:install-file-Dfile=/home/wukong/res/jersey-guice-1.8.jar-DgroupId=com.sun.jersey.contribs-DartifactId=jersey-guice-Dversion=1.8-Dpackaging=jar

7. Use ant build pig again. Finally!

This is the end of the article on "how to compile Pig-0.13.0". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report