maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-mboot2/src/main/java MBoot.java
Date Tue, 27 Jul 2004 16:59:04 GMT
jvanzyl     2004/07/27 09:59:04

  Modified:    maven-mboot2/src/main/java MBoot.java
  Log:
  o added an offline mode to the bootstrap, so on my machine I can bootstrap
    in 20s when ibiblio isn't consulted.
  
  Revision  Changes    Path
  1.7       +24 -9     maven-components/maven-mboot2/src/main/java/MBoot.java
  
  Index: MBoot.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/MBoot.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MBoot.java	27 Jul 2004 11:24:04 -0000	1.6
  +++ MBoot.java	27 Jul 2004 16:59:04 -0000	1.7
  @@ -105,6 +105,8 @@
   
       private List coreDeps;
   
  +    private boolean online = true;
  +
       // ----------------------------------------------------------------------
       //
       // ----------------------------------------------------------------------
  @@ -120,7 +122,7 @@
       public void run( String[] args )
           throws Exception
       {
  -        File mavenPropertiesFile =  new File( System.getProperty( "user.home" ), "maven.properties"
);
  +        File mavenPropertiesFile = new File( System.getProperty( "user.home" ), "maven.properties"
);
   
           if ( !mavenPropertiesFile.exists() )
           {
  @@ -143,7 +145,14 @@
           {
               String key = (String) i.next();
   
  -            properties.setProperty( key, StringUtils.interpolate( properties.getProperty(key),
System.getProperties() ) );
  +            properties.setProperty( key, StringUtils.interpolate( properties.getProperty(
key ), System.getProperties() ) );
  +        }
  +
  +        String onlineProperty = properties.getProperty( "maven.online" );
  +
  +        if ( onlineProperty != null && onlineProperty.equals( "false" ) )
  +        {
  +            online = false;
           }
   
           downloader = new ArtifactDownloader( properties );
  @@ -154,13 +163,18 @@
   
           String basedir = System.getProperty( "user.dir" );
   
  -        checkMBootDeps();
  +        mbootDependencies = Arrays.asList( deps );
  +
  +        if ( online )
  +        {
  +            checkMBootDeps();
  +        }
   
           // Install maven-components POM
  -        installPomFile( repoLocal,  new File( basedir, "pom.xml" ) );
  +        installPomFile( repoLocal, new File( basedir, "pom.xml" ) );
   
           // Install plugin-parent POM
  -        installPomFile( repoLocal,  new File( basedir, "maven-plugins/pom.xml" ) );
  +        installPomFile( repoLocal, new File( basedir, "maven-plugins/pom.xml" ) );
   
           for ( int i = 0; i < builds.length; i++ )
           {
  @@ -356,9 +370,12 @@
           // Download deps
           // ----------------------------------------------------------------------
   
  -        System.out.println( "Downloading dependencies ..." );
  +        if ( online )
  +        {
  +            System.out.println( "Downloading dependencies ..." );
   
  -        downloadDependencies( reader.getDependencies() );
  +            downloadDependencies( reader.getDependencies() );
  +        }
   
           // ----------------------------------------------------------------------
           // Generating sources
  @@ -525,8 +542,6 @@
           throws Exception
       {
           System.out.println( "Checking for MBoot's dependencies ..." );
  -
  -        mbootDependencies = Arrays.asList( deps );
   
           downloader.downloadDependencies( mbootDependencies );
       }
  
  
  

Mime
View raw message