The entire shell has a limit on the length of the command line. The UNIX / Linux / BSD has a limit on the number of bytes that can be used for a command line argument and environment variables.
When you start a new process or type a command, these restrictions apply and an error message appears on the screen as follows:
Argument list too long
Cobertura tries to execute a shell command:
getLog().debug( "Working Directory: " + cl.getWorkingDirectory() ); getLog().debug( "Executing command line:" ); getLog().debug( cl.toString() ); int exitCode; try { exitCode = CommandLineUtils.executeCommandLine( cl, stdout, stderr ); } catch ( CommandLineException e ) { throw new MojoExecutionException( "Unable to execute Cobertura.", e ); }
In fact, the plugin is trying to execute a java process to start cobertura:
Commandline cl = new Commandline(); File java = new File( SystemUtils.getJavaHome(), "bin/java" ); cl.setExecutable( java.getAbsolutePath() ); cl.addEnvironment("CLASSPATH", createClasspath()); String log4jConfig = getLog4jConfigFile(); if ( log4jConfig != null ) { cl.createArg().setValue( "-Dlog4j.configuration=" + log4jConfig ); } cl.createArg().setValue( "-Xmx" + maxmem ); cl.createArg().setValue( taskClass ); if ( cmdLineArgs.useCommandsFile() ) { String commandsFile; try { commandsFile = cmdLineArgs.getCommandsFile(); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to obtain CommandsFile location.", e ); } if ( FileUtils.fileExists( commandsFile ) ) { cl.createArg().setValue( "--commandsfile" ); cl.createArg().setValue( commandsFile ); } else { throw new MojoExecutionException( "CommandsFile doesn't exist: " + commandsFile ); } } else { Iterator<String> it = cmdLineArgs.iterator(); while ( it.hasNext() ) { cl.createArg().setValue( it.next() ); } }
So, first of all, enable the DEBUG cobalter trace to show the executed shell command.
I think the problem will be the class path used in version 2.6, and the one used in version 2.5.1.
Please enable debug tracing and post the result:
https://wiki.jenkins-ci.org/display/JENKINS/Logging
jfcorugedo
source share