some cleanup to execute file - still doesnt work when spaces in path

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@177940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-05-23 08:16:29 +00:00
parent 4b1c539878
commit 84bde74bf4
1 changed files with 11 additions and 14 deletions

View File

@ -130,9 +130,14 @@ public class JavadocReport
cl.createArgument().setValue( "-classpath" );
cl.createArgument().setValue( classpath.toString() );
cl.createArgument().setValue( "@files" );
System.out.println( getJavadocPath() );
System.out.println( Commandline.toString( cl.getCommandline() ) );
System.out.println( cl.getWorkingDirectory() );
CommandLineUtils.executeCommandLine( cl, new DefaultConsumer(), new DefaultConsumer() );
int exitCode = CommandLineUtils.executeCommandLine( cl, new DefaultConsumer(), new DefaultConsumer() );
if ( exitCode != 0 )
{
throw new MavenReportException( "exit code: " + exitCode );
}
}
catch ( Exception e )
{
@ -171,18 +176,10 @@ public class JavadocReport
*/
private String getJavadocPath()
{
String osName = System.getProperty( "os.name" );
String jdkPath;
if ( osName.startsWith( "Windows" ) )
{
jdkPath = "%JAVA_HOME%";
}
else
{
jdkPath = "$JAVA_HOME";
}
// TODO: this could probably be improved/configured
// TODO: doesn't work with spaces in java.home
String fileSeparator = System.getProperty( "file.separator" );
return jdkPath + fileSeparator + "bin" + fileSeparator + "javadoc";
File f = new File( System.getProperty( "java.home" ), "bin/javadoc" );
return f.getAbsolutePath();
}
}
}