ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5541] New: - Javadoc task fails on AIX because javadoc executable is found in the wrong directory
Date Thu, 20 Dec 2001 16:33:31 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5541>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5541

Javadoc task fails on AIX because javadoc executable is found in the wrong directory

           Summary: Javadoc task fails on AIX because javadoc executable is
                    found in the wrong directory
           Product: Ant
           Version: 1.4.1
          Platform: Other
        OS/Version: AIX
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: naresh.sikha@schwab.com
                CC: naresh.sikha@schwab.com


===
=== OVERVIEW DESCRIPTION:
===
The Javadoc task fails on AIX. The problem is the same problem that was fixed 
in the case of finding the java command inside the ${ant.home}/bin/ant script - 
AIX JDK puts executables in */sh directories instead of */bin directories. The 
Javadoc task, in getJavadocExecutableName() method only looks to */bin 
directories (the defacto standard, but IBM breaks this). I am including the 
full text of the patched version of the method since we are CVS-challenged at 
Schwab (if you really need a diff -u I can provide one by the end of the day).

===
=== STEPS TO REPRODUCE:
===
1. Using Jakarta Ant 1.4.1 on AIX (IBM JDK 1.2.2, but I would guess any IBM JDK 
will do) attempt to run a build.xml with a target that invokes the Javadoc 
task. It will always fail since the task is hardcoded to look for javadoc in 
the wrong directory. More specifically, an invalid version of the javadoc 
executable can be found in ${java.home}/bin/javadoc, but the executable that 
should be used is ${java.home}/sh/javadoc (only on AIX/IBM JDK).

===
=== ACTUAL RESULTS (always reproduceable without patch described below):
===
Buildfile: build.xml

api:
    [mkdir] Created dir: /CommonJavaComponents/repository/logger/docs/api
  [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/t
ools/javadoc/Main

===
=== EXPECTED RESULTS (always reproduceable with path described below):
===
Buildfile: build.xml

api:
    [mkdir] Created dir: /CommonJavaComponents/repository/logger/docs/api
  [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Loading source files for package com.schwab.base.log...
  [javadoc] Loading source files for package com.schwab.runtime.log...
  [javadoc] Loading source files for package com.schwab.domain.system.audit.call
ableservice...
  [javadoc] Loading source files for package com.schwab.domain.system.audit.log.
..
  [javadoc] Loading source files for package com.schwab.domain.system.audit.scen
ario...
  [javadoc] Loading source files for package com.schwab.domain.system.log.format
ter...
  [javadoc] Loading source files for package com.schwab.domain.system.log.handle
r...
  [javadoc] Loading source files for package com.schwab.logger.util...
  [javadoc] Constructing Javadoc information...
  [javadoc] Building tree for all the packages and classes...
  [javadoc] Building index for all the packages and classes...
  [javadoc] javadoc: warning - Tag @link: Class or Package not found: Records
  [javadoc] javadoc: warning - Tag @link: Class or Package not found: Records
  [javadoc] Building index for all classes...
  [javadoc] javadoc: warning - Tag @link: Class or Package not found: Records
  [javadoc] javadoc: warning - Tag @link: Class or Package not found: com.schwab
.base.BusinessParameters#getLogger
  [javadoc] javadoc: warning - Tag @link: Class or Package not found: com.schwab
.base.BusinessResults#getLogger
  [javadoc] javadoc: warning - Tag @link: Class or Package not found: com.schwab
.base.presentation.ReplyBroker#getLogger
  [javadoc] javadoc: warning - com.schwab.base.log.Level.name: Tag @see: can't f
ind Level in com.schwab.base.log.Level
  [javadoc] javadoc: warning - com.schwab.base.log.Level.name: Tag @see: can't f
ind getName in com.schwab.base.log.Level
  [javadoc] javadoc: warning - com.schwab.base.log.Level.value: Tag @see: can't
find Level in com.schwab.base.log.Level
  [javadoc] Generating /CommonJavaComponents/repository/logger/docs/api/styleshe
et.css...
  [javadoc] 9 warnings

BUILD SUCCESSFUL

Total time: 14 seconds

===
=== BUILD DATE & PLATFORM:
===
Ant version 1.4.1 compiled on December 20 2001
Buildfile: build.xml
Detected Java version: 1.2 in: /usr/IBMWebAS/java/jre/sh/..
Detected OS: AIX

===
=== PATCHED VERSION OF 
com.schwab.tools.ant.taskdefs.Javadoc.getJavadocExecutableName() FOLLOWS:
===

    private String getJavadocExecutableName()
    {
	// This is the most common extension case - exe for windows and OS/2, 
        // nothing for *nix.
        String os = System.getProperty("os.name").toLowerCase();
        boolean dosBased = 
            os.indexOf("windows") >= 0 || os.indexOf("os/2") >= 0;
	String extension =  dosBased? ".exe" : "";

    // Look for javadoc in the java.home/../sh directory (AIX specific).
    File jdocExecutable = new File( System.getProperty("java.home") +
        "/../sh/javadoc" + extension );
    
    if (jdocExecutable.exists())
    {
        return jdocExecutable.getAbsolutePath();
    }
    else
    {
        // Look for javadoc in the java.home/../bin directory.  Unfortunately
        // on Windows java.home doesn't always refer to the correct location, 
        // so we need to fall back to assuming javadoc is somewhere on the
        // PATH.
        jdocExecutable = new File( System.getProperty("java.home") +
            "/../bin/javadoc" + extension );

        if (jdocExecutable.exists())
        {
            return jdocExecutable.getAbsolutePath();
        }
        else
        {
            log( "Unable to locate " + jdocExecutable.getAbsolutePath() +
                ". Using \"javadoc\" instead.", Project.MSG_VERBOSE );
            return "javadoc";
        }
    }
    }

===
=== END PATCHED VERISON
===

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message