maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject cvs commit: maven-components/maven-mboot2/src/main/java/download ArtifactDownloader.java
Date Mon, 04 Apr 2005 21:32:53 GMT
jdcasey     2005/04/04 14:32:53

  Modified:    maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources
                        ResourcesMojo.java
               maven-core/src/main/java/org/apache/maven/project
                        DefaultMavenProjectBuilder.java
               maven-core/src/main/resources/org/apache/maven/project
                        pom-4.0.0.xml
               maven-mboot2/src/main/java/download ArtifactDownloader.java
  Log:
  o Simplified the ResourcesMojo to eliminate the need for a ResourceEntry class, which is
easily replaced by usage of a TreeMap (avoid the NoClassDefFoundError from before SEE MNG-243)
  o Changed the references to repo1.maven.org for central repository to repo1.maven.org/maven2
in preparation for switchover to ibiblio.org
  
      This will allow us to transparently switch between redirects and CNAME changes for referencing
ibiblio.org, since ibiblio will not allow a
      vhost for m2 or a rewrite rule...switching the URL for the repo will allow changes to
the CNAME (satisfy ibiblio's pathing) while at the same
      time allowing the use of redirects (redirect can be at /maven2/index.html rather than
/index.html, f.e.).
  
  Revision  Changes    Path
  1.16      +15 -33    maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
  
  Index: ResourcesMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ResourcesMojo.java	22 Mar 2005 14:26:28 -0000	1.15
  +++ ResourcesMojo.java	4 Apr 2005 21:32:52 -0000	1.16
  @@ -30,6 +30,9 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
  +import java.util.Map;
  +import java.util.TreeMap;
  +import java.util.Map.Entry;
   
   /**
    * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
  @@ -62,18 +65,20 @@
       {
           try
           {
  -            for ( Iterator i = getJarResources( resources ).iterator(); i.hasNext(); )
  +            for ( Iterator i = getJarResources( resources ).entrySet().iterator(); i.hasNext();
)
               {
  -                ResourceEntry resourceEntry = (ResourceEntry) i.next();
  -
  -                File destinationFile = new File( outputDirectory, resourceEntry.getDestination()
);
  +                Map.Entry entry = (Entry) i.next();
  +                String source = (String) entry.getKey();
  +                String destination = (String) entry.getValue();
  +                
  +                File destinationFile = new File( outputDirectory, destination );
   
                   if ( !destinationFile.getParentFile().exists() )
                   {
                       destinationFile.getParentFile().mkdirs();
                   }
   
  -                fileCopy( resourceEntry.getSource(), destinationFile.getPath() );
  +                fileCopy( source, destinationFile.getPath() );
               }
           }
           catch ( Exception e )
  @@ -83,10 +88,10 @@
           }
       }
   
  -    private List getJarResources( List resources )
  +    private Map getJarResources( List resources )
           throws Exception
       {
  -        List resourceEntries = new ArrayList();
  +        Map resourceEntries = new TreeMap();
   
           for ( Iterator i = resources.iterator(); i.hasNext(); )
           {
  @@ -139,9 +144,9 @@
                       entryName = targetPath + "/" + name;
                   }
   
  -                ResourceEntry je = new ResourceEntry( new File( resource.getDirectory(),
name ).getPath(), entryName );
  +                String resourcePath = new File( resource.getDirectory(), name ).getPath();
   
  -                resourceEntries.add( je );
  +                resourceEntries.put( resourcePath, entryName );
               }
           }
   
  @@ -185,27 +190,4 @@
           fileWrite( outFileName, content );
       }
   
  -    class ResourceEntry
  -    {
  -        private String source;
  -
  -        private String destination;
  -
  -        public ResourceEntry( String source, String entry )
  -        {
  -            this.source = source;
  -
  -            this.destination = entry;
  -        }
  -
  -        public String getSource()
  -        {
  -            return source;
  -        }
  -
  -        public String getDestination()
  -        {
  -            return destination;
  -        }
  -    }
   }
  
  
  
  1.61      +1 -1      maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
  
  Index: DefaultMavenProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- DefaultMavenProjectBuilder.java	29 Mar 2005 16:41:13 -0000	1.60
  +++ DefaultMavenProjectBuilder.java	4 Apr 2005 21:32:52 -0000	1.61
  @@ -374,7 +374,7 @@
   
           Repository pluginRepo = new Repository();
           pluginRepo.setId( "plugin-repository" );
  -        pluginRepo.setUrl( "http://repo1.maven.org" );
  +        pluginRepo.setUrl( "http://repo1.maven.org/maven2" );
   
           // TODO: [jc] change this to detect the repository layout type somehow...
           String repoLayoutId = "legacy";
  
  
  
  1.11      +10 -10    maven-components/maven-core/src/main/resources/org/apache/maven/project/pom-4.0.0.xml
  
  Index: pom-4.0.0.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/resources/org/apache/maven/project/pom-4.0.0.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- pom-4.0.0.xml	1 Apr 2005 05:47:29 -0000	1.10
  +++ pom-4.0.0.xml	4 Apr 2005 21:32:53 -0000	1.11
  @@ -6,7 +6,7 @@
       <repository>
         <id>central</id>
         <name>Maven Repository Switchboard</name>
  -      <url>http://repo1.maven.org</url>
  +      <url>http://repo1.maven.org/maven2</url>
       </repository>
     </repositories>
   
  @@ -33,22 +33,22 @@
       <pluginManagement>
         <plugins>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-compiler-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-resources-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-jar-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
             <configuration>
  @@ -61,27 +61,27 @@
             </configuration>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-clean-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-deploy-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-install-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-pom-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
           <plugin>
  -          <groupId>maven</groupId>
  +          <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-plugin-plugin</artifactId>
             <version>1.0-SNAPSHOT</version>
           </plugin>
  
  
  
  1.11      +1 -1      maven-components/maven-mboot2/src/main/java/download/ArtifactDownloader.java
  
  Index: ArtifactDownloader.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/download/ArtifactDownloader.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ArtifactDownloader.java	4 Apr 2005 14:35:06 -0000	1.10
  +++ ArtifactDownloader.java	4 Apr 2005 21:32:53 -0000	1.11
  @@ -115,7 +115,7 @@
           if ( repositories.isEmpty() )
           {
               // TODO: use super POM?
  -            Repository repository = new Repository( "http://repo1.maven.org", Repository.LAYOUT_LEGACY
);
  +            Repository repository = new Repository( "http://repo1.maven.org/maven2", Repository.LAYOUT_LEGACY
);
               remoteRepos.add( repository );
           }
       }
  
  
  

Mime
View raw message