Moving offline notice to avoid embedded cases.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@593040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2007-11-08 06:44:26 +00:00
parent ed568e725f
commit 4c2d75b726
3 changed files with 14 additions and 2 deletions

View File

@ -168,6 +168,11 @@ public class MavenCli
mavenEmbedder = new MavenEmbedder( configuration ); mavenEmbedder = new MavenEmbedder( configuration );
logger = mavenEmbedder.getLogger(); logger = mavenEmbedder.getLogger();
if ( mavenEmbedder.isOffline( request ) )
{
logger.info( "You are working in offline mode." );
}
} }
catch ( MavenEmbedderException e ) catch ( MavenEmbedderException e )
{ {

View File

@ -778,6 +778,15 @@ public class MavenEmbedder
// Start of new embedder API // Start of new embedder API
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
public boolean isOffline( MavenExecutionRequest request )
throws MavenEmbedderException
{
// first, grab defaults including settings, in case <offline>true</offline> is set.
request = populator.populateDefaults( request, configuration );
return request.isOffline();
}
public MavenExecutionResult execute( MavenExecutionRequest request ) public MavenExecutionResult execute( MavenExecutionRequest request )
{ {
LoggerManager loggerManager = container.getLoggerManager(); LoggerManager loggerManager = container.getLoggerManager();

View File

@ -470,8 +470,6 @@ public class DefaultMavenExecutionRequestPopulator
if ( request.isOffline() ) if ( request.isOffline() )
{ {
getLogger().info( "You are working in offline mode." );
wagonManager.setOnline( false ); wagonManager.setOnline( false );
} }
else else