Fixing broken JPackage Ant rpm for use with 3rd party JARs such as Ivy
# ant
Buildfile: build.xml
resolve:
BUILD FAILED
/usr/local/apache-ivy-2.3.0-rc1/src/example/hello-ivy/build.xml:38: Problem: failed to create task or type antlib:org.apache.ivy.ant:retrieve
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/usr/share/ant/lib
-/root/.ant/lib
-a directory added on the command line with the -lib argument
Total time: 0 seconds
Now apparently people have been getting this problem as far back as 2008! I found this bug which gave some insight as to what is going on:ASF Bugzilla – Bug 44849
The solution I implemented was to edit the ant.conf file, which looks like this:
# cat /etc/ant.conf
# ant.conf (Ant 1.7.x)
# JPackage Project <http://www.jpackage.org/>
# Validate --noconfig setting in case being invoked
# from pre Ant 1.6.x environment
if [ -z "$no_config" ] ; then
no_config=true
fi
# Setup ant configuration
if $no_config ; then
# Disable RPM layout
rpm_mode=false
else
# Use RPM layout
rpm_mode=true
# ANT_HOME for rpm layout
ANT_HOME=/usr/share/ant
fi
and I changed the line with rpm_mode=true to rpm_mode=false. Ivy then works fine. I am sure this effects many other 3rd party JAR files being used with Ant as well. It's very frustrating to have to do this, hopefully someone at JPackage makes corrections to Ant. Here is the build of hello-ivy after the change to /etc/ant.conf:
# ant
Buildfile: build.xml
resolve:
:: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
:: loading settings :: url = jar:file:/usr/share/ant/lib/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: org.apache#hello-ivy;working@localhost
confs:
found commons-lang#commons-lang;2.0 in public
found commons-cli#commons-cli;1.0 in public
found commons-logging#commons-logging;1.0 in public
:: resolution report :: resolve 177ms :: artifacts dl 11ms
:: evicted modules:
commons-lang#commons-lang;1.0 by in
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 4 | 0 | 0 | 1 || 7 | 0 |
---------------------------------------------------------------------
:: retrieving :: org.apache#hello-ivy
confs:
0 artifacts copied, 7 already retrieved (0kB/6ms)
run:
standard message : hello ivy !
capitalized by org.apache.commons.lang.WordUtils : Hello Ivy !
BUILD SUCCESSFUL
Total time: 0 seconds Hopefully this helps others having the same problem.
Recent Posts
See AllRecently I was working on a problem with Time Series. Time Series can quickly add up to a lot of data, as you are using previous...
One of the biggest bottlenecks in Deep Learning is loading data. having fast drives and access to the data is important, especially if...
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.TableName;...
コメント