cliRequest.logger = new PrintStreamLogger( cliRequest.stdout ); cliRequest.logger.setStream( cliRequest.stdout );
private void commands( CliRequest cliRequest ) { if ( cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.SHOW_VERSION ) ) { CLIReportingUtils.showVersion( cliRequest.stdout ); } if ( cliRequest.showErrors ) { cliRequest.logger.info( "Error stacktraces are turned on." ); } // // TODO: move checksum policies to // if ( MavenExecutionRequest.CHECKSUM_POLICY_WARN.equals( cliRequest.request.getGlobalChecksumPolicy() ) ) { cliRequest.logger.info( "Disabling strict checksum verification on all artifact downloads." ); } else if ( MavenExecutionRequest.CHECKSUM_POLICY_FAIL.equals( cliRequest.request.getGlobalChecksumPolicy() ) ) { cliRequest.logger.info( "Enabling strict checksum verification on all artifact downloads." ); } }
cliRequest.logger.debug( "Reading user settings from " + userSettingsFile ); cliRequest.logger.debug( "Reading global settings from " + globalSettingsFile ); if ( !settingsResult.getProblems().isEmpty() && cliRequest.logger.isWarnEnabled() ) cliRequest.logger.warn( "" ); cliRequest.logger.warn( "Some problems were encountered while building the effective settings" ); cliRequest.logger.warn( problem.getMessage() + " @ " + problem.getLocation() ); cliRequest.logger.warn( "" );
public MavenExecutionListener(Maven3Builder maven3Builder) { this.maven3Builder = maven3Builder; this.proxies = new HashMap<ModuleName, MavenBuildProxy2>(maven3Builder.proxies); for (Entry<ModuleName,MavenBuildProxy2> e : this.proxies.entrySet()) { e.setValue(maven3Builder.new FilterImpl(e.getValue(), maven3Builder.mavenBuildInformation)); executedMojosPerModule.put( e.getKey(), new CopyOnWriteArrayList<ExecutedMojo>() ); } this.reporters.putAll( new HashMap<ModuleName, List<MavenReporter>>(maven3Builder.reporters) ); this.eventLogger = new ExecutionEventLogger( new PrintStreamLogger( maven3Builder.listener.getLogger() ) ); }
cliRequest.logger.debug( "Reading user settings from " + userSettingsFile ); cliRequest.logger.debug( "Reading global settings from " + globalSettingsFile ); if ( !settingsResult.getProblems().isEmpty() && cliRequest.logger.isWarnEnabled() ) cliRequest.logger.warn( "" ); cliRequest.logger.warn( "Some problems were encountered while building the effective settings" ); cliRequest.logger.warn( problem.getMessage() + " @ " + problem.getLocation() ); cliRequest.logger.warn( "" );
public static int main( String[] args ) throws Exception { ClassLoader orig = Thread.currentThread().getContextClassLoader(); try { ClassRealm containerRealm = (ClassRealm) Thread.currentThread().getContextClassLoader(); ContainerConfiguration cc = new DefaultContainerConfiguration().setName( "maven" ) .setRealm( containerRealm ); DefaultPlexusContainer container = new DefaultPlexusContainer( cc ); MavenLoggerManager mavenLoggerManager = new MavenLoggerManager( new PrintStreamLogger( System.out ) ); container.setLoggerManager( mavenLoggerManager ); Maven maven = (Maven) container.lookup( "org.apache.maven.Maven", "default" ); MavenExecutionRequest request = getMavenExecutionRequest( args, container ); MavenExecutionResult result = maven.execute( request ); hudsonMavenExecutionResult = new HudsonMavenExecutionResult( result ); // we don't care about cli mavenExecutionResult will be study in the the plugin return 0;// cli.doMain( args, null ); } catch ( ComponentLookupException e ) { throw new Exception( e.getMessage(), e ); } finally { Thread.currentThread().setContextClassLoader( orig ); } }
cliRequest.logger = new PrintStreamLogger( cliRequest.stdout ); cliRequest.logger.setStream( cliRequest.stdout );
public static int main( String[] args ) throws Exception { ClassLoader orig = Thread.currentThread().getContextClassLoader(); try { ClassRealm containerRealm = (ClassRealm) Thread.currentThread().getContextClassLoader(); ContainerConfiguration cc = new DefaultContainerConfiguration().setName( "maven" ) .setRealm( containerRealm ); DefaultPlexusContainer container = new DefaultPlexusContainer( cc ); MavenLoggerManager mavenLoggerManager = new MavenLoggerManager( new PrintStreamLogger( System.out ) ); container.setLoggerManager( mavenLoggerManager ); Maven maven = (Maven) container.lookup( "org.apache.maven.Maven", "default" ); MavenExecutionRequest request = getMavenExecutionRequest( args, container ); MavenExecutionResult result = maven.execute( request ); hudsonMavenExecutionResult = new HudsonMavenExecutionResult( result ); // we don't care about cli mavenExecutionResult will be study in the the plugin return 0;// cli.doMain( args, null ); } catch ( ComponentLookupException e ) { throw new Exception( e.getMessage(), e ); } finally { Thread.currentThread().setContextClassLoader( orig ); } }
private void commands( CliRequest cliRequest ) { if ( cliRequest.debug || cliRequest.commandLine.hasOption( CLIManager.SHOW_VERSION ) ) { CLIReportingUtils.showVersion( cliRequest.stdout ); } if ( cliRequest.showErrors ) { cliRequest.logger.info( "Error stacktraces are turned on." ); } // // TODO: move checksum policies to // if ( MavenExecutionRequest.CHECKSUM_POLICY_WARN.equals( cliRequest.request.getGlobalChecksumPolicy() ) ) { cliRequest.logger.info( "Disabling strict checksum verification on all artifact downloads." ); } else if ( MavenExecutionRequest.CHECKSUM_POLICY_FAIL.equals( cliRequest.request.getGlobalChecksumPolicy() ) ) { cliRequest.logger.info( "Enabling strict checksum verification on all artifact downloads." ); } }