maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-mboot2/src/main/java MBoot.java
Date Thu, 02 Sep 2004 12:50:46 GMT
brett       2004/09/02 05:50:46

  Modified:    maven-mboot2/src/main/java MBoot.java
  Log:
  actually, you can specify a sys property instead
  
  Revision  Changes    Path
  1.22      +16 -6     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- MBoot.java	2 Sep 2004 12:34:19 -0000	1.21
  +++ MBoot.java	2 Sep 2004 12:50:46 -0000	1.22
  @@ -142,13 +142,25 @@
           File userPomFile = new File( System.getProperty( "user.home" ), ".m2/pom.xml" );
   
           reader = new ModelReader();
  -        if ( !reader.parse( userPomFile ) )
  +
  +        if ( userPomFile.exists() && !reader.parse( userPomFile ) )
  +        {
  +            System.err.println( "Error reading user POM file" );
  +
  +            System.exit( 1 );
  +        }
  +
  +        String mavenRepoLocal = System.getProperty( "maven.repo.local", reader.getLocal().getRepository()
);
  +
  +        if ( mavenRepoLocal == null )
           {
               System.out.println( "You must have a ~/.m2/pom.xml file and must contain the
following entries:" );
  -            System.out.println( "<local>\n" );
  -            System.out.println( "  <repository>/path/to/m2/repository</repository>
(required)\n" );
  -            System.out.println( "  <online>true</online> (optional)\n" );
  +            System.out.println( "<local>" );
  +            System.out.println( "  <repository>/path/to/m2/repository</repository>
(required)" );
  +            System.out.println( "  <online>true</online> (optional)" );
               System.out.println( "</local>" );
  +            System.out.println();
  +            System.out.println( "Alternatively, you can specify -Dmaven.repo.local=/path/to/m2/repository"
);
   
               System.exit( 1 );
           }
  @@ -183,8 +195,6 @@
           {
               online = false;
           }
  -
  -        String mavenRepoLocal = System.getProperty( "maven.repo.local", reader.getLocal().getRepository()
);
   
           downloader = new ArtifactDownloader( mavenRepoLocal, reader.getRemoteRepositories()
);
   
  
  
  

Mime
View raw message