Lucene - Core
  1. Lucene - Core
  2. LUCENE-3946

improve docs & ivy verification output to explain classpath problems and mention "--noconfig"

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      offshoot of LUCENE-3930, where shawn reported...

      I can't get either branch_3x or trunk to build now, on a system that used to build branch_3x without complaint. It
      says that ivy is not available, even after doing "ant ivy-bootstrap" to download ivy into the home directory.
      Specifically I am trying to build solrj from trunk, but I can't even get "ant" in the root directory of the checkout
      to work. I'm on CentOS 6 with oracle jdk7 built using the city-fan.org SRPMs. Ant (1.7.1) and junit are installed
      from package repositories. Building a checkout of lucene_solr_3_5 on the same machine works fine.

      The root cause is that ant's global configs can be setup to ignore the users personal lib dir. suggested work arround is to run "ant --noconfig" but we should also try to give the user feedback in our failure about exactly what classpath ant is currently using (because apparently $

      {java.class.path}

      is not actually it)

        Issue Links

          Activity

          Uwe Schindler made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Hoss Man added a comment -

          thanks shawn, i added that as a suggestion on the wiki...

          http://wiki.apache.org/lucene-java/HowToContribute#antivy

          moving forward if we get questions from users about ivy problems we just need to iterate and update the wiki with what works best

          Show
          Hoss Man added a comment - thanks shawn, i added that as a suggestion on the wiki... http://wiki.apache.org/lucene-java/HowToContribute#antivy moving forward if we get questions from users about ivy problems we just need to iterate and update the wiki with what works best
          Hide
          Shawn Heisey added a comment -

          Yes, putting rpm_mode=false in ~/.ant/ant.conf works too. I just got a bug filed with Redhat, hopefully they don't complain too much about it actually being CentOS.

          https://bugzilla.redhat.com/show_bug.cgi?id=810067

          Show
          Shawn Heisey added a comment - Yes, putting rpm_mode=false in ~/.ant/ant.conf works too. I just got a bug filed with Redhat, hopefully they don't complain too much about it actually being CentOS. https://bugzilla.redhat.com/show_bug.cgi?id=810067
          Robert Muir made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Robert Muir added a comment -

          Committed revision 1309559 to 3.x.

          Show
          Robert Muir added a comment - Committed revision 1309559 to 3.x.
          Hide
          Robert Muir added a comment -

          I think Hoss hopped on a plane. I'll merge his commit.

          Show
          Robert Muir added a comment - I think Hoss hopped on a plane. I'll merge his commit.
          Hide
          Robert Muir added a comment -

          Anyone object to merging this back to 3.6?

          +1

          Show
          Robert Muir added a comment - Anyone object to merging this back to 3.6? +1
          Hoss Man made changes -
          Fix Version/s 3.6 [ 12319070 ]
          Affects Version/s 3.6 [ 12319070 ]
          Hide
          Hoss Man added a comment -

          I added some starter text to http://wiki.apache.org/lucene-java/HowToContribute#antivy

          I also went ahead and commited the existing patch as is, minus the classpath stuff, to the trunk: r1309511.

          Anyone object to merging this back to 3.6?

          Commenting out "rpm_mode=true" in ant.conf made it work with just "ant test" as the command.

          Shawn: can you try reverting your change to /etc/ant.conf and instead add "rpm_mode=false" to a new $HOME/.ant/ant.conf file and see if that works just as well? ... if so we should add it to the wiki as a suggestion

          Show
          Hoss Man added a comment - I added some starter text to http://wiki.apache.org/lucene-java/HowToContribute#antivy I also went ahead and commited the existing patch as is, minus the classpath stuff, to the trunk: r1309511. Anyone object to merging this back to 3.6? – Commenting out "rpm_mode=true" in ant.conf made it work with just "ant test" as the command. Shawn: can you try reverting your change to /etc/ant.conf and instead add "rpm_mode=false" to a new $HOME/.ant/ant.conf file and see if that works just as well? ... if so we should add it to the wiki as a suggestion
          Hide
          Hoss Man added a comment -

          I think rather than suggesting the --noconfig option in the patch, we should

          just reword the text to suggest instead installing your own ant (which worked for both you and Mike) rather than using any system-installed one on Linux systems.

          Given that "--noconfig" or editing ant.conf to remove rpm_mode may solve the problem, and that many people are likely to consider either of those things simpler to do then installing a clean version of ant (even though you and i would probably disagree) i think we should still suggest them possible fixes.

          Show
          Hoss Man added a comment - I think rather than suggesting the --noconfig option in the patch, we should just reword the text to suggest instead installing your own ant (which worked for both you and Mike) rather than using any system-installed one on Linux systems. Given that "--noconfig" or editing ant.conf to remove rpm_mode may solve the problem, and that many people are likely to consider either of those things simpler to do then installing a clean version of ant (even though you and i would probably disagree) i think we should still suggest them possible fixes.
          Hide
          Michael McCandless added a comment -

          Shawn, I'm not certain this is the same issue (it talks about an extra trailing / on ANT_HOME, but that didn't help me...), but it seems related: https://bugzilla.redhat.com/show_bug.cgi?id=490542

          Show
          Michael McCandless added a comment - Shawn, I'm not certain this is the same issue (it talks about an extra trailing / on ANT_HOME, but that didn't help me...), but it seems related: https://bugzilla.redhat.com/show_bug.cgi?id=490542
          Hide
          Shawn Heisey added a comment -

          Interesting late development. Commenting out "rpm_mode=true" in ant.conf made it work with just "ant test" as the command. If I can figure out how to file a bug with Redhat, I will do so.

          Show
          Shawn Heisey added a comment - Interesting late development. Commenting out "rpm_mode=true" in ant.conf made it work with just "ant test" as the command. If I can figure out how to file a bug with Redhat, I will do so.
          Hide
          Robert Muir added a comment -

          Thanks Shawn, I think rather than suggesting the --noconfig option in the patch, we should
          just reword the text to suggest instead installing your own ant (which worked for both you
          and Mike) rather than using any system-installed one on Linux systems.

          Show
          Robert Muir added a comment - Thanks Shawn, I think rather than suggesting the --noconfig option in the patch, we should just reword the text to suggest instead installing your own ant (which worked for both you and Mike) rather than using any system-installed one on Linux systems.
          Hide
          Shawn Heisey added a comment -

          Robert's comment shows that he saw this:

          /home/fedora/branch_3x/lucene/build.xml:48: No supported regular
          expression matcher found: java.lang.ClassNotFoundException:
          org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher

          On CentOS 6, there is a ant-apache-regexp package. Poking around the ivy jar with the Classpath Helper in eclipse, I also saw that it will probably need ant-apache-oro and possibly other optional packages. I have installed every optional ant package I could find on mine, and it didn't help.

          ant-apache-bcel-1.7.1-13.el6.x86_64
          ant-javamail-1.7.1-13.el6.x86_64
          ant-nodeps-1.7.1-13.el6.x86_64
          ant-apache-bsf-1.7.1-13.el6.x86_64
          ant-apache-resolver-1.7.1-13.el6.x86_64
          ant-commons-net-1.7.1-13.el6.x86_64
          ant-contrib-1.0-0.10.b2.el6.noarch
          ant-commons-logging-1.7.1-13.el6.x86_64
          ant-javadoc-1.7.1-13.el6.x86_64
          ant-jdepend-1.7.1-13.el6.x86_64
          ant-apache-regexp-1.7.1-13.el6.x86_64
          ant-trax-1.7.1-13.el6.x86_64
          ant-junit-1.7.1-13.el6.x86_64
          ant-swing-1.7.1-13.el6.x86_64
          ant-jmf-1.7.1-13.el6.x86_64
          ant-scripts-1.7.1-13.el6.x86_64
          ant-jsch-1.7.1-13.el6.x86_64
          ant-apache-oro-1.7.1-13.el6.x86_64
          ant-apache-log4j-1.7.1-13.el6.x86_64
          ant-1.7.1-13.el6.x86_64
          ant-antunit-1.1-4.el6.noarch

          Checking the java.class.path spit out by the downloaded ant, there appear to be things that it includes that are not available as optional packages. I know from previous experience that filing a bug with CentOS is useless, they'll just tell me to file a bug with Redhat. Since I've never given Redhat a single penny, I will have to research how to file a bug with them.

          Show
          Shawn Heisey added a comment - Robert's comment shows that he saw this: /home/fedora/branch_3x/lucene/build.xml:48: No supported regular expression matcher found: java.lang.ClassNotFoundException: org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher On CentOS 6, there is a ant-apache-regexp package. Poking around the ivy jar with the Classpath Helper in eclipse, I also saw that it will probably need ant-apache-oro and possibly other optional packages. I have installed every optional ant package I could find on mine, and it didn't help. ant-apache-bcel-1.7.1-13.el6.x86_64 ant-javamail-1.7.1-13.el6.x86_64 ant-nodeps-1.7.1-13.el6.x86_64 ant-apache-bsf-1.7.1-13.el6.x86_64 ant-apache-resolver-1.7.1-13.el6.x86_64 ant-commons-net-1.7.1-13.el6.x86_64 ant-contrib-1.0-0.10.b2.el6.noarch ant-commons-logging-1.7.1-13.el6.x86_64 ant-javadoc-1.7.1-13.el6.x86_64 ant-jdepend-1.7.1-13.el6.x86_64 ant-apache-regexp-1.7.1-13.el6.x86_64 ant-trax-1.7.1-13.el6.x86_64 ant-junit-1.7.1-13.el6.x86_64 ant-swing-1.7.1-13.el6.x86_64 ant-jmf-1.7.1-13.el6.x86_64 ant-scripts-1.7.1-13.el6.x86_64 ant-jsch-1.7.1-13.el6.x86_64 ant-apache-oro-1.7.1-13.el6.x86_64 ant-apache-log4j-1.7.1-13.el6.x86_64 ant-1.7.1-13.el6.x86_64 ant-antunit-1.1-4.el6.noarch Checking the java.class.path spit out by the downloaded ant, there appear to be things that it includes that are not available as optional packages. I know from previous experience that filing a bug with CentOS is useless, they'll just tell me to file a bug with Redhat. Since I've never given Redhat a single penny, I will have to research how to file a bug with them.
          Hide
          Shawn Heisey added a comment -

          The broken ant in CentOS 6.2:
          Apache Ant version 1.7.1 compiled on August 24 2010

          I don't have a real RHEL 6.x to check this on, it's probably a different date. Downloading, installing, and using ant 1.7.1 fixed it for me. I can actually still call the /usr/bin/ant script in the regular path, but explicitly setting ANT_HOME overrides what it actually uses. When I first found this problem, I did install the apache-ivy package, then when that didn't work, I noticed the ivy-bootstrap option.

          Trying some of the workarounds mentioned resulted in an error:

          ncindex@bigindy5 /index/src/trunk/solr $ ant --noconfig resolve
          Error: Could not find or load main class org.apache.tools.ant.launch.Launcher

          Show
          Shawn Heisey added a comment - The broken ant in CentOS 6.2: Apache Ant version 1.7.1 compiled on August 24 2010 I don't have a real RHEL 6.x to check this on, it's probably a different date. Downloading, installing, and using ant 1.7.1 fixed it for me. I can actually still call the /usr/bin/ant script in the regular path, but explicitly setting ANT_HOME overrides what it actually uses. When I first found this problem, I did install the apache-ivy package, then when that didn't work, I noticed the ivy-bootstrap option. Trying some of the workarounds mentioned resulted in an error: ncindex@bigindy5 /index/src/trunk/solr $ ant --noconfig resolve Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
          Hide
          Sami Siren added a comment -

          FWIW I am running Fedora 16. I did:

          yum install ant ant-junit apache-ivy
          ant clean test
          

          I see warnings like:

          [ivy:retrieve] impossible to define new type: class not found: org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator in [] nor Ivy classloader
          

          and:

              [junit] WARNING: multiple versions of ant detected in path for junit 
              [junit]          jar:file:/usr/share/java/ant.jar!/org/apache/tools/ant/Project.class
              [junit]      and jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
          

          But the build works and there are no test failures (3.x, r1309249);

          Show
          Sami Siren added a comment - FWIW I am running Fedora 16. I did: yum install ant ant-junit apache-ivy ant clean test I see warnings like: [ivy:retrieve] impossible to define new type: class not found: org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator in [] nor Ivy classloader and: [junit] WARNING: multiple versions of ant detected in path for junit [junit] jar:file:/usr/share/java/ant.jar!/org/apache/tools/ant/Project.class [junit] and jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class But the build works and there are no test failures (3.x, r1309249);
          Hide
          Robert Muir added a comment -

          that REALLY smells bad ... and would go out of it's way to break things for people who might have already fixed their ant install (using "--noconfig" or edited /etc/ant.conf)

          I think it's enough to make the failure message say "we did our best, try --noconfig and see the URL below for more info about how your ant install may be fucked up" ... if we can show them the correct classpath ant is trying to use t load ivy, to make the point clear, then great – if not, then we rip it out of hte error message

          I think you misread my logic: If ivy is unavailable, and this date is April 16 2010, then we know its a fucked ant.

          Show
          Robert Muir added a comment - that REALLY smells bad ... and would go out of it's way to break things for people who might have already fixed their ant install (using "--noconfig" or edited /etc/ant.conf) I think it's enough to make the failure message say "we did our best, try --noconfig and see the URL below for more info about how your ant install may be fucked up" ... if we can show them the correct classpath ant is trying to use t load ivy, to make the point clear, then great – if not, then we rip it out of hte error message I think you misread my logic: If ivy is unavailable, and this date is April 16 2010, then we know its a fucked ant.
          Hide
          Hoss Man added a comment -

          I passed --execdebug to ant, and when it fails (w/ the builtin Fedora ant) I get this:

          the interesting thing being that neither of those lines actually seem to contain your ivy.jar – but when it fails for you, the java.class.path echoing that my patch adds to the ivy-check target does show ivy in that classpath (even though it's clearly not the one being used to load the taskdef) ... so something in the actual Launcher class is deciding when/if to add that ivy jar to that java.class.path (which again: is clearly not hte classpath that actually seems to matter)

          So forget about loading ivy, I think these ants shipped with linux distributions are hopelessly broken and I don't think there is a lot we can do.

          that's not really fair ... many distros split things up ito multiple pacakges, you probably have the core one but not some optional ones.

          as mike has shown it's clearly possible to get a functional ant with a fedora install, but you do have to override/edit a config setting

          Maybe this 'compiled-on-date' is available via an ant property we can early detect?

          that REALLY smells bad ... and would go out of it's way to break things for people who might have already fixed their ant install (using "--noconfig" or edited /etc/ant.conf)

          I think it's enough to make the failure message say "we did our best, try --noconfig and see the URL below for more info about how your ant install may be fucked up" ... if we can show them the correct classpath ant is trying to use t load ivy, to make the point clear, then great – if not, then we rip it out of hte error message

          Show
          Hoss Man added a comment - I passed --execdebug to ant, and when it fails (w/ the builtin Fedora ant) I get this: the interesting thing being that neither of those lines actually seem to contain your ivy.jar – but when it fails for you, the java.class.path echoing that my patch adds to the ivy-check target does show ivy in that classpath (even though it's clearly not the one being used to load the taskdef) ... so something in the actual Launcher class is deciding when/if to add that ivy jar to that java.class.path (which again: is clearly not hte classpath that actually seems to matter) So forget about loading ivy, I think these ants shipped with linux distributions are hopelessly broken and I don't think there is a lot we can do. that's not really fair ... many distros split things up ito multiple pacakges, you probably have the core one but not some optional ones. as mike has shown it's clearly possible to get a functional ant with a fedora install, but you do have to override/edit a config setting Maybe this 'compiled-on-date' is available via an ant property we can early detect? that REALLY smells bad ... and would go out of it's way to break things for people who might have already fixed their ant install (using "--noconfig" or edited /etc/ant.conf) I think it's enough to make the failure message say "we did our best, try --noconfig and see the URL below for more info about how your ant install may be fucked up" ... if we can show them the correct classpath ant is trying to use t load ivy, to make the point clear, then great – if not, then we rip it out of hte error message
          Hide
          Robert Muir added a comment -

          Here's my version information for the bogus ant:
          Apache Ant version 1.7.1 compiled on April 16 2010

          Maybe this 'compiled-on-date' is available via an ant property we can early detect?
          If ivy is unavailable, and this date is April 16 2010, then we know its a fucked ant.

          Sure, its possible someone actually compiled ant themselves on that day AND
          hasn't yet bootstrapped ivy, but we could print a different message for these broken
          ants telling them to install their own ant.

          Show
          Robert Muir added a comment - Here's my version information for the bogus ant: Apache Ant version 1.7.1 compiled on April 16 2010 Maybe this 'compiled-on-date' is available via an ant property we can early detect? If ivy is unavailable, and this date is April 16 2010, then we know its a fucked ant. Sure, its possible someone actually compiled ant themselves on that day AND hasn't yet bootstrapped ivy, but we could print a different message for these broken ants telling them to install their own ant.
          Hide
          Michael McCandless added a comment -

          I passed --execdebug to ant, and when it fails (w/ the builtin Fedora ant) I get this:

          exec "/usr/local/src/jdk1.6.0_21/bin/java" -classpath "/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/ant.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/javamail.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/share/java/xalan-j2-serializer.jar:/usr/local/src/jdk1.6.0_21/lib/tools.jar" -Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib" org.apache.tools.ant.launch.Launcher -cp ""
          

          and then when I switch to the working ant:

          exec "/usr/local/src/jdk1.6.0_21/jre/bin/java" -classpath "/usr/local/src/apache-ant-1.8.2//lib/ant-launcher.jar" -Dant.home="/usr/local/src/apache-ant-1.8.2/" -Dant.library.dir="/usr/local/src/apache-ant-1.8.2//lib" org.apache.tools.ant.launch.Launcher -cp ""
          
          Show
          Michael McCandless added a comment - I passed --execdebug to ant, and when it fails (w/ the builtin Fedora ant) I get this: exec "/usr/local/src/jdk1.6.0_21/bin/java" -classpath "/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/ant.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/javamail.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/share/java/xalan-j2-serializer.jar:/usr/local/src/jdk1.6.0_21/lib/tools.jar" -Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib" org.apache.tools.ant.launch.Launcher -cp "" and then when I switch to the working ant: exec "/usr/local/src/jdk1.6.0_21/jre/bin/java" -classpath "/usr/local/src/apache-ant-1.8.2//lib/ant-launcher.jar" -Dant.home="/usr/local/src/apache-ant-1.8.2/" -Dant.library.dir="/usr/local/src/apache-ant-1.8.2//lib" org.apache.tools.ant.launch.Launcher -cp ""
          Hide
          Michael McCandless added a comment -

          Patch works – I see lots of JARs on the classpath:

               [echo]      Current Classpath:
               [echo]        /usr/share/java/ant.jar
               [echo]        /usr/share/java/ant-launcher.jar
               [echo]        /usr/share/java/jaxp_parser_impl.jar
               [echo]        /usr/share/java/xml-commons-apis.jar
               [echo]        /usr/share/java/antlr.jar
               [echo]        /usr/share/java/ant/ant-antlr.jar
               [echo]        /usr/share/java/bcel.jar
               [echo]        /usr/share/java/ant/ant-apache-bcel.jar
               [echo]        /usr/share/java/oro.jar
               [echo]        /usr/share/java/ant/ant-apache-oro.jar
               [echo]        /usr/share/java/regexp.jar
               [echo]        /usr/share/java/ant/ant-apache-regexp.jar
               [echo]        /usr/share/java/xml-commons-resolver.jar
               [echo]        /usr/share/java/ant/ant-apache-resolver.jar
               [echo]        /usr/share/java/jakarta-commons-logging.jar
               [echo]        /usr/share/java/ant/ant-commons-logging.jar
               [echo]        /usr/share/java/javamail.jar
               [echo]        /usr/share/java/jaf.jar
               [echo]        /usr/share/java/ant/ant-javamail.jar
               [echo]        /usr/share/java/jdepend.jar
               [echo]        /usr/share/java/ant/ant-jdepend.jar
               [echo]        /usr/share/java/junit.jar
               [echo]        /usr/share/java/ant/ant-junit.jar
               [echo]        /usr/share/java/ant/ant-nodeps.jar
               [echo]        /usr/share/java/ant/ant-swing.jar
               [echo]        /usr/share/java/jaxp_transform_impl.jar
               [echo]        /usr/share/java/ant/ant-trax.jar
               [echo]        /usr/share/java/xalan-j2-serializer.jar
               [echo]        /usr/local/src/jdk1.6.0_21/lib/tools.jar
               [echo]        /home/mike/.ant/lib/maven-ant-tasks-2.1.3.jar
               [echo]        /home/mike/.ant/lib/ivy-2.2.0.jar
               [echo]        /usr/share/ant/lib/ant-swing.jar
               [echo]        /usr/share/ant/lib/ant-launcher.jar
               [echo]        /usr/share/ant/lib/ant-junit.jar
               [echo]        /usr/share/ant/lib/ant-bootstrap.jar
               [echo]        /usr/share/ant/lib/ant-apache-bcel.jar
               [echo]        /usr/share/ant/lib/ant-apache-oro.jar
               [echo]        /usr/share/ant/lib/ant-nodeps.jar
               [echo]        /usr/share/ant/lib/ant-apache-resolver.jar
               [echo]        /usr/share/ant/lib/ant-trax.jar
               [echo]        /usr/share/ant/lib/ant-apache-log4j.jar
               [echo]        /usr/share/ant/lib/ant-antlr.jar
               [echo]        /usr/share/ant/lib/ant-javamail.jar
               [echo]        /usr/share/ant/lib/ant-jdepend.jar
               [echo]        /usr/share/ant/lib/ant-apache-regexp.jar
               [echo]        /usr/share/ant/lib/ant-commons-logging.jar
          

          That's just running "ant", and it fails... "ant --noconfig" works (fortunately I don't have/need ~/.antrc). Here's my /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
          
          Show
          Michael McCandless added a comment - Patch works – I see lots of JARs on the classpath: [echo] Current Classpath: [echo] /usr/share/java/ant.jar [echo] /usr/share/java/ant-launcher.jar [echo] /usr/share/java/jaxp_parser_impl.jar [echo] /usr/share/java/xml-commons-apis.jar [echo] /usr/share/java/antlr.jar [echo] /usr/share/java/ant/ant-antlr.jar [echo] /usr/share/java/bcel.jar [echo] /usr/share/java/ant/ant-apache-bcel.jar [echo] /usr/share/java/oro.jar [echo] /usr/share/java/ant/ant-apache-oro.jar [echo] /usr/share/java/regexp.jar [echo] /usr/share/java/ant/ant-apache-regexp.jar [echo] /usr/share/java/xml-commons-resolver.jar [echo] /usr/share/java/ant/ant-apache-resolver.jar [echo] /usr/share/java/jakarta-commons-logging.jar [echo] /usr/share/java/ant/ant-commons-logging.jar [echo] /usr/share/java/javamail.jar [echo] /usr/share/java/jaf.jar [echo] /usr/share/java/ant/ant-javamail.jar [echo] /usr/share/java/jdepend.jar [echo] /usr/share/java/ant/ant-jdepend.jar [echo] /usr/share/java/junit.jar [echo] /usr/share/java/ant/ant-junit.jar [echo] /usr/share/java/ant/ant-nodeps.jar [echo] /usr/share/java/ant/ant-swing.jar [echo] /usr/share/java/jaxp_transform_impl.jar [echo] /usr/share/java/ant/ant-trax.jar [echo] /usr/share/java/xalan-j2-serializer.jar [echo] /usr/local/src/jdk1.6.0_21/lib/tools.jar [echo] /home/mike/.ant/lib/maven-ant-tasks-2.1.3.jar [echo] /home/mike/.ant/lib/ivy-2.2.0.jar [echo] /usr/share/ant/lib/ant-swing.jar [echo] /usr/share/ant/lib/ant-launcher.jar [echo] /usr/share/ant/lib/ant-junit.jar [echo] /usr/share/ant/lib/ant-bootstrap.jar [echo] /usr/share/ant/lib/ant-apache-bcel.jar [echo] /usr/share/ant/lib/ant-apache-oro.jar [echo] /usr/share/ant/lib/ant-nodeps.jar [echo] /usr/share/ant/lib/ant-apache-resolver.jar [echo] /usr/share/ant/lib/ant-trax.jar [echo] /usr/share/ant/lib/ant-apache-log4j.jar [echo] /usr/share/ant/lib/ant-antlr.jar [echo] /usr/share/ant/lib/ant-javamail.jar [echo] /usr/share/ant/lib/ant-jdepend.jar [echo] /usr/share/ant/lib/ant-apache-regexp.jar [echo] /usr/share/ant/lib/ant-commons-logging.jar That's just running "ant", and it fails... "ant --noconfig" works (fortunately I don't have/need ~/.antrc). Here's my /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
          Hide
          Robert Muir added a comment -

          I'm hoping Shawn and McCandless (who also mentioned being able to reproduce this with a stock Fedora install of ant) can verify that they get consistent/useful behavior when running things like...

          I spent 5 minutes trying to do this:

          1. installed fedora 13 into vm (image: http://virtualboxes.org/images/fedora/)
          2. yum install ant
          3. yum install svn
          4. download jdk7 tar.gz from oracle.com, set it to JAVA_HOME, and put its bin/ in PATH,
          5. svn co branch_3x

          As soon as I run 'ant test' to try to do anything, i see:

          [fedora@localhost lucene]$ ant test
          Buildfile: build.xml
          
          test-core:
          
          BUILD FAILED
          /home/fedora/branch_3x/lucene/build.xml:48: No supported regular
          expression matcher found: java.lang.ClassNotFoundException:
          org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher
          
          Total time: 0 seconds
          

          So forget about loading ivy, I think these ants shipped with linux distributions are hopelessly broken
          and I don't think there is a lot we can do.

          Show
          Robert Muir added a comment - I'm hoping Shawn and McCandless (who also mentioned being able to reproduce this with a stock Fedora install of ant) can verify that they get consistent/useful behavior when running things like... I spent 5 minutes trying to do this: installed fedora 13 into vm (image: http://virtualboxes.org/images/fedora/ ) yum install ant yum install svn download jdk7 tar.gz from oracle.com, set it to JAVA_HOME, and put its bin/ in PATH, svn co branch_3x As soon as I run 'ant test' to try to do anything, i see: [fedora@localhost lucene]$ ant test Buildfile: build.xml test-core: BUILD FAILED /home/fedora/branch_3x/lucene/build.xml:48: No supported regular expression matcher found: java.lang.ClassNotFoundException: org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher Total time: 0 seconds So forget about loading ivy, I think these ants shipped with linux distributions are hopelessly broken and I don't think there is a lot we can do.
          Hoss Man made changes -
          Attachment LUCENE-3946.patch [ 12521237 ]
          Hide
          Hoss Man added a comment -

          patch that updates the ivy-availability-check to include:

          • a mention of --noconfig
          • a link to the wiki (where we'd need to add some content)
          • an echo of the classpath

          ...i'm using $

          {java.class.path} here because from what i can tell doing testing with "-nouserlib" that's the right classpath to look at – but i'm a little worried based on Shawn's comment in LUCENE-3930 that when he added an echo of ${java.class.path}

          he did in fact see the ~/.ant/lib jar in there.

          I'm hoping Shawn and McCandless (who also mentioned being able to reproduce this with a stock Fedora install of ant) can verify that they get consistent/useful behavior when running things like...

          • "ant --noconfig resolve" (should work for anyone using default ant)
          • "ant resolve" (should work for most, but expect to fail on these fedora systems because of packaged /etc/ant.conf, but our failure message should show a classpath that clearly indicates ~/.ant/lib/ivy.jar isn't in there)
          • "ant --noconfig resolve" (should work for anyone)
          • "ant -nouserlib resolve" (should fail for anyone, our failure message should show a classpath that clearly indicates ~/.ant/lib/ivy.jar isn't in there)
          Show
          Hoss Man added a comment - patch that updates the ivy-availability-check to include: a mention of --noconfig a link to the wiki (where we'd need to add some content) an echo of the classpath ...i'm using $ {java.class.path} here because from what i can tell doing testing with "-nouserlib" that's the right classpath to look at – but i'm a little worried based on Shawn's comment in LUCENE-3930 that when he added an echo of ${java.class.path} he did in fact see the ~/.ant/lib jar in there. I'm hoping Shawn and McCandless (who also mentioned being able to reproduce this with a stock Fedora install of ant) can verify that they get consistent/useful behavior when running things like... "ant --noconfig resolve" (should work for anyone using default ant) "ant resolve" (should work for most, but expect to fail on these fedora systems because of packaged /etc/ant.conf, but our failure message should show a classpath that clearly indicates ~/.ant/lib/ivy.jar isn't in there) "ant --noconfig resolve" (should work for anyone) "ant -nouserlib resolve" (should fail for anyone, our failure message should show a classpath that clearly indicates ~/.ant/lib/ivy.jar isn't in there)
          Show
          Hoss Man added a comment - Related... http://ant.1045680.n5.nabble.com/Ant-and-rpm-mode-td1353437.html http://stackoverflow.com/questions/1909634/why-does-ant-ignore-task-jars-in-home-ant-lib
          Hoss Man made changes -
          Assignee Hoss Man [ hossman ]
          Fix Version/s 4.0 [ 12314025 ]
          Affects Version/s 3.6 [ 12319070 ]
          Hide
          Hoss Man added a comment -

          hopefully just a a doc and ant <echo> fix ... i'll try to get this in for 3.6

          Show
          Hoss Man added a comment - hopefully just a a doc and ant <echo> fix ... i'll try to get this in for 3.6
          Hoss Man made changes -
          Field Original Value New Value
          Link This issue relates to LUCENE-3930 [ LUCENE-3930 ]
          Hoss Man created issue -

            People

            • Assignee:
              Hoss Man
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development