if ( log != null && log.isDebugEnabled() )
{
log.debug( "Invoking Maven for the goals: " + goals + " with "
+ ( properties == null ? "no properties" : "properties=" + properties ) );
}
InvocationResult result = invoke( log, invoker, request, invokerLog, goals, properties, null );
if ( result.getExitCode() != 0 )
{
String invokerLogContent = readFile( invokerLog, "UTF-8" );
// see DefaultMaven
if ( invokerLogContent != null && ( invokerLogContent.indexOf( "Scanning for projects..." ) == -1
|| invokerLogContent.indexOf( OutOfMemoryError.class.getName() ) != -1 ) )
{
if ( log != null )
{
log.error( "Error occurred during initialization of VM, trying to use an empty MAVEN_OPTS..." );
if ( log.isDebugEnabled() )
{
log.debug( "Reinvoking Maven for the goals: " + goals + " with an empty MAVEN_OPTS..." );
}
}
result = invoke( log, invoker, request, invokerLog, goals, properties, "" );
}
}
if ( result.getExitCode() != 0 )
{
String invokerLogContent = readFile( invokerLog, "UTF-8" );
// see DefaultMaven
if ( invokerLogContent != null && ( invokerLogContent.indexOf( "Scanning for projects..." ) == -1