Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problem by declaring a resource "antcontrib"

Help
Jens
2006-09-13
2013-04-24
  • Jens
    Jens
    2006-09-13

    Hello,

    I have a problem with my build.xml file since I´m using ...

    A)
    WinXP Prof
    SDK 1.4.2_12
    Eclipse 3.2 (Lomboz for JavaEE Dev 3.1.2 installed too)
    ant4eclipse 0.4.1
    ant-contrib 0.6

    Before I used ...

    B)
    WinXP Prof
    SDK 1.4.2_08
    Eclipse 3.1.1 (without Lomboz)
    ant4eclipse 0.3.1
    ant-contrib 0.3

    and the build.xml worked fine.

    Both installations use ANT 1.6.5 that comes within Eclipse. The ant-contrib-x.x.jar is in the lib Folder of the ANT-Plugin.

    In installation B) I could use ...

    <taskdef resource="net/sf/ant4eclipse/antlib.xml" />
    <taskdef resource="net/sf/antcontrib/antlib.xml" />

    Environment:
    ANT_HOME = xxx\plugins\org.apache.ant_1.6.5
    Path = plugins\org.apache.ant_1.6.5\bin

    I do not need to set the CLASSPATH, it works fine.

    In installation B) I use ...

    <taskdef resource="net/sf/ant4eclipse/antlib.xml" />
    <taskdef resource="net/sf/antcontrib/antcontrib.properties" />

    Environment:
    ANT_HOME = xxx\plugins\org.apache.ant_1.6.5
    Path = xxx\plugins\org.apache.ant_1.6.5\bin

    It doesn´t work. There is a message ...

    "Buildfile: C:\JavaDev\Eclipse_Tomcat\webapps\odLogin\build.xml
      [taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.
    init:"

    So I set the CLASSPATH "xxx\plugins\org.apache.ant_1.6.5\lib" but it doesn´t work too.

    Only if I use ...

    <taskdef resource="net/sf/antcontrib/antcontrib.properties" >
      <classpath>
        <pathelement location="xxx/plugins/org.apache.ant_1.6.5/lib/ant-contrib-0.6.jar" />
      </classpath>
    </taskdef>

    The message will no longer displayed.

    Any ideas?

    Thx,
    Jens

     
    • Jens
      Jens
      2006-09-13

      sry ... the second "In installation B)" will mean "In installation A)"

       
    • Matt Inger
      Matt Inger
      2006-10-06

      Seems like a problem with the eclipse classloader.  I've never had a problem running ant scripts from clipse 3.2, though I don't typically use their ant installation.  I usually re-assign the ant home.