Can not compile Nutch1.4 with ant - ant

all
I'm trying to deploy Nutch1.4 to Hadoop cluster(following this page). I got some problems when compiling Nutch with ant.
problem 1
When I run ant command, I got the following error:
/home/xenserver/apache-nutch-1.4-bin/build.xml:71: invalid Date syntax in "01/25/1971 2:00 pm"
I remove attribute "datetime" from line 71 in file build.xml and run ant again. Then I got another problem.
problem 2
The error is:
/home/xenserver/apache-nutch-1.4/build.xml:412: syntax errors in ivy file: java.text.ParseException: http://java.sun.com/xml/jaxp/properties/schemaLanguage in file:/home/xenserver/apache-nutch-1.4/ivy/ivy.xml
at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:273)
........
What's wrong with the steps above? Is there any tutorial for compiling Nutch1.4?
Need your help.Thanks in advance.

For compiling nutch 1.4, all you have to do is run ant clean deploy from the nutch directory. The output is created in the directory named 'runtime' with 2 folders: one for local mode and other one for cluster mode.
please check the date settings and ant installation on your machine. I think that is casing the issue. Also have you tampered/ edited /home/xenserver/apache-nutch-1.4/ivy/ivy.xml ? Please check that file too.
EDIT:
There is some problem with the build file when executed on your Linux box.
Check these out: this and this.
These are the things that you should verify on your setup:
java version and ant version : dont use old ones. get the latest ones or ones that are compatible with your nutch release. FYI: for nutch-1.4 I am using apache-ant-1.8.3 and java jdk1.6.0_18. This combination works perfectly fine with me.
Check that you have installed a JDK and not a JRE
Check if your JAVA_HOME environment variable point to the JDK. System PATH variable must have $JAVA_HOME/bin and $ANT_HOME/bin appended to it. ANT_HOME variable must point to the ant installation directory.
Can you successfully run normal ant targets on any other build files ? try out with small ant build file.
Still facing the same issue, run ant command with -v option. This will provide more information about the error faced.
eg.
ant -v clean deploy

Related

Intellij's live inspection fails to find external references in ANT build files

I have a project with different modules bundled into each others.
We build with ant and I have no problem running the Ant build inside Intellij if I provide the path to the generic build files through a property (repository.dir : C:/myRepositoryFolder).
Similarly, I have no problem running my ant build in command line given I have set my environment variable ANT-OPTS with -Drepository.dir=C:/myRepositoryFolder
However, Intellij does not know where to find this folder and therefore the inspection 'Ant inspections / Ant references resolve problems' blow off on most of my build.xml.
Does anybody know where I can show Intellij where to find this folder without modifying my existent build.properties?
Thanks in advance!

Jenkins Cannot find executable for ANT

I'm using the automatic installation option for Ant but still jenkins complains that it cannot find the executable. Am I missing something? I have given the path to the ant version we use. It has successfully downloaded and unpacked it on the server but it still complains it can't find the executable.
Did you install Ant? Is it in Jenkin's PATH? If not, Jenkins cannot use the default version of Ant.
However, if you go into the Jenkins configuration page, you can install various versions of Ant. For example, you may want to install the latest version of Ant, and Ant 1.5 for that one project that cannot use any version of Ant beyond 1.5:
When you define your project, you can select the version of Ant you want to use. When you select that you want to Invoke Ant as a build step, you are given a drop down menu of what version of Ant you want to use. The first is the Default which is the Ant version found in your PATH. However, if you've gone into Jenkins configuration and downloaded other versions of Ant, you can use one of those instead.
I think is more easy to you install ant manually , or you need check the jenkins log file for detailed errors
Found what I missed. I had to add the name of the directory it unpacks the ant file to in the
"Subdirectory of extracted archive" field. Forgot to mention we are using a fairly old version of ant. (1.7.0).

xjc with annox running from command prompt

I have tried to run a example from the website http://confluence.highsource.org/display/J2B/Annotate+Plugin#AnnotatePlugin-Activation. The very first schema provided in the webpage and I saved it as schema.xsd under c:\jaxb folder. Then, I ran the command 'xjc -extension schema.xsd' from command prompt and I get the similar error. Apparently xjc doesn't seem to understand this url http://annox.dev.java.net. How do I solve this?
You have to add the annotate plugin with all the dependencies to the classpath. See this Ant build file for what dependencies are
You have to activate the plugin using -Xannotate switch
Here's a sample Ant project. I'll assemble a command-line example for the next version.

"JUnitTask was not found" error (Hudson, Ant, JUnit)

I tried several ways to install ant and junit on the same server as hudson. I eventually downloaded the Ant source, installed the optional dependencies by using the included fetch.xml file, built the source code, and dropped junit-4.8.1.jar into the lib directory where the compiled ant code [that I just built] is. Then I set ANT_HOME to the ant root directory by using the "export ANT_HOME=/usr/share/ant" command. I also set a Hudson configuration variable of "ANT_HOME" with the same value (/usr/share/ant) and I also put a new file into the /etc/profile.d directory with the export ANT_HOME command as well. At this point I'm not sure what else to try, but Hudson still gives me the error:
BUILD FAILED /var/lib/hudson/jobs/MyProject/build.xml:31: Problem:
failed to create task or type junit Cause: the class
org.apache.tools.ant.taskdefs.optional.junit.JUnitTask 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
-/var/lib/hudson/.ant/lib
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem. The commonest cause is a
missing JAR.
This is not a bug; it is a configuration problem
I did, in fact, check /usr/share/ant/lib and the class "org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.class" is located in the ant-junit jar file as I confirmed by running the command: jar tfv ant-junit.jar | grep org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
Can someone please tell me what to try, I am not sure where to go from here.
If you are on Ubuntu you can simply apt-get ant; I did that and linked to the junit jar within my project.
Cheers,
Neil
It turns out that hudson itself installs some version of Ant in one of its own libraries. I suppose that somehow caused a conflict because when I got rid of it, things worked. I think it is in /var/hudson or /var/hudson/lib. That path is added to the PATH environment variable during hudson installation. So your choice is either to add your own Ant install to the BEGINNING of the path, to delete hudson's version of Ant, or to delete that part of the PATH.

Cannot resolve symbol 'scp' in IntelliJ IDEA 11 Ant build script

I'm running IntelliJ IDEA 11 on Ubuntu Linux. I have an existing project that I've imported into IDEA with a build script that performs a bunch of <scp> tasks. IntelliJ is underlining all of my <scp> tasks and giving me the message of cannot resolve symbol even though I have jsch-0.1.42.jar both on my Global Classpath in IntelliJ as well as on the Additional Classpath for this specific Ant file.
What do I need to do so that IntelliJ will recognize <scp> as a valid task?
I was having this same problem with IntelliJ version 12.1.4. I solved it by putting jsch-0.1.50.jar into the default ant directory of IntelliJ (IntelliJ IDEA 12.1.4\lib\ant\lib).
We can't reproduce the problem, scp is correctly recognized in the editor and works with just jsch-0.1.45.jar added to the Additional Classpath:
Please submit a bug with an isolated test case and the steps to reproduce if you still have this problem.
You can solve your problem for all additional jar by installing them in a user scope.
If you have an ant installation, run
ant -f fetch.xml -Ddest=user
A step by step can be found here

Resources