maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject cvs commit: maven-components/maven-core/src/test/java/org/apache/maven/project/helpers ProjectTestHelper.java
Date Wed, 23 Jun 2004 18:04:18 GMT
michal      2004/06/23 11:04:18

  Modified:    maven-core/src/test/resources/projects project.xml
                        fully-populated-child.xml
               maven-core/src/main/java/org/apache/maven/artifact/deployer
                        DefaultArtifactDeployer.java
               maven-core/src/main/java/org/apache/maven/project/inheritance
                        DefaultModelInheritanceAssembler.java
               maven-core/src/main/java/org/apache/maven/project
                        MavenProject.java
               maven-core/src/test/java/org/apache/maven/project/helpers
                        ProjectTestHelper.java
  Log:
  Pushing back my changes to model.
  
  Revision  Changes    Path
  1.2       +12 -3     maven-components/maven-core/src/test/resources/projects/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/projects/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	11 Jun 2004 15:11:56 -0000	1.1
  +++ project.xml	23 Jun 2004 18:04:17 -0000	1.2
  @@ -12,9 +12,18 @@
     <shortDescription>shortDescription</shortDescription>
     <url>http://maven.apache.org/</url>
     <issueTrackingUrl>issueTrackingUrl</issueTrackingUrl>
  -  <siteAddress>maven.apache.org</siteAddress>
  -  <siteDirectory>/www/maven.apache.org/</siteDirectory>
  -  <distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
  +  <distributionManagment>
  +    <repository>
  +      <id>distributionRepositoryId</id>
  +      <name>distributionRepositoryName</name>
  +      <url>distributionRepository</url>
  +    </repository>
  +    <site>
  +      <id>siteDistributionId</id>
  +      <name>siteDistributionName</name>
  +      <url>siteDistributionUrl</url>
  +     </site>
  +  </distributionManagment>
   
     <organization>
       <name>Apache Software Foundation</name>
  
  
  
  1.2       +12 -3     maven-components/maven-core/src/test/resources/projects/fully-populated-child.xml
  
  Index: fully-populated-child.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/projects/fully-populated-child.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- fully-populated-child.xml	11 Jun 2004 15:11:56 -0000	1.1
  +++ fully-populated-child.xml	23 Jun 2004 18:04:17 -0000	1.2
  @@ -18,9 +18,18 @@
     <shortDescription>shortDescription</shortDescription>
     <url>http://maven.apache.org/</url>
     <issueTrackingUrl>issueTrackingUrl</issueTrackingUrl>
  -  <siteAddress>maven.apache.org</siteAddress>
  -  <siteDirectory>/www/maven.apache.org/</siteDirectory>
  -  <distributionDirectory>/www/maven.apache.org/builds/</distributionDirectory>
  +  <distributionManagment>
  +    <repository>
  +      <id>childDistributionRepositoryId</id>
  +      <name>childDistributionRepositoryName</name>
  +      <url>childDistributionRepository</url>
  +    </repository>
  +    <site>
  +      <id>childSiteDistributionId</id>
  +      <name>childSiteDistributionName</name>
  +      <url>childSiteDistributionUrl</url>
  +     </site>
  +  </distributionManagment>
   
     <organization>
       <name>Apache Software Foundation</name>
  
  
  
  1.5       +13 -26    maven-components/maven-core/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
  
  Index: DefaultArtifactDeployer.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultArtifactDeployer.java	23 Jun 2004 15:26:32 -0000	1.4
  +++ DefaultArtifactDeployer.java	23 Jun 2004 18:04:18 -0000	1.5
  @@ -51,46 +51,33 @@
               }
   
   
  -            String host = distributionManagement.getHost();
   
  -            if ( host == null )
  +            if ( distributionManagement.getRepository() == null )
               {
  -                String msg = "host element is missing in the POM: "
  +                String msg = "distributionManagment/repository element is missing in the
POM: "
                           + project.getId();
   
  +                throw new Exception( msg );
  +
               }
   
  +            String url = distributionManagement.getRepository().getUrl();
   
  -            String directory = distributionManagement.getDirectory();
  +            String id = distributionManagement.getRepository().getId();
   
  -            if ( directory == null )
  +            if (  url == null )
               {
  -                String msg = "directory element is missing in the POM: "
  +                String msg = "distributionManagment/repository/url element is missing in
the POM: "
                           + project.getId();
   
  -            }
  -
  -
  -
  -            String protocol = PathUtils.protocol(  host );
  -
  -            wagon = wagonManager.getWagon( protocol  );
  +                throw new Exception( msg );
   
  -            Repository repository = new Repository();
  -
  -            String url;
  -
  -            if ( host.endsWith( "/"  ) )
  -            {
  -                 url = host + directory;
               }
   
  -            else
  -            {
  -               url = host + "/"  +directory;
  -            }
   
  -            repository.setUrl( url );
  +            Repository repository = new Repository( id, url );
  +
  +            wagon = wagonManager.getWagon( repository.getUrl()  );
   
               wagon.connect( repository );
   
  
  
  
  1.5       +2 -13     maven-components/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java
  
  Index: DefaultModelInheritanceAssembler.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultModelInheritanceAssembler.java	20 Jun 2004 13:36:34 -0000	1.4
  +++ DefaultModelInheritanceAssembler.java	23 Jun 2004 18:04:18 -0000	1.5
  @@ -65,18 +65,7 @@
               child.setUrl( parent.getUrl() );
           }
   
  -        // siteAddress
  -        if ( child.getSiteAddress() == null )
  -        {
  -            child.setSiteAddress( parent.getSiteAddress() );
  -        }
  -
  -        // siteDirectory
  -        if ( child.getSiteDirectory() == null )
  -        {
  -            child.setSiteDirectory( parent.getSiteDirectory() );
  -        }
  -
  +        
           // ----------------------------------------------------------------------
           // Distribution
           // ----------------------------------------------------------------------
  
  
  
  1.13      +1 -32     maven-components/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
  
  Index: MavenProject.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/MavenProject.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MavenProject.java	23 Jun 2004 15:16:17 -0000	1.12
  +++ MavenProject.java	23 Jun 2004 18:04:18 -0000	1.13
  @@ -17,19 +17,7 @@
    */
   
   import org.apache.maven.artifact.MavenArtifact;
  -import org.apache.maven.model.Build;
  -import org.apache.maven.model.Contributor;
  -import org.apache.maven.model.Dependency;
  -import org.apache.maven.model.Developer;
  -import org.apache.maven.model.IssueManagement;
  -import org.apache.maven.model.License;
  -import org.apache.maven.model.MailingList;
  -import org.apache.maven.model.Model;
  -import org.apache.maven.model.Organization;
  -import org.apache.maven.model.Repository;
  -import org.apache.maven.model.Resource;
  -import org.apache.maven.model.Scm;
  -import org.apache.maven.model.DistributionManagement;
  +import org.apache.maven.model.*;
   import org.codehaus.plexus.util.StringUtils;
   
   import java.io.File;
  @@ -456,25 +444,6 @@
           return getModel().getIssueManagement();
       }
   
  -    public void setSiteAddress( String siteAddress )
  -    {
  -        getModel().setSiteAddress( siteAddress );
  -    }
  -
  -    public String getSiteAddress()
  -    {
  -        return getModel().getSiteAddress();
  -    }
  -
  -    public void setSiteDirectory( String siteDirectory )
  -    {
  -        getModel().setSiteDirectory( siteDirectory );
  -    }
  -
  -    public String getSiteDirectory()
  -    {
  -        return getModel().getSiteDirectory();
  -    }
   
       public void setDistributionManagement( DistributionManagement distributionManagement
)
       {
  
  
  
  1.4       +16 -10    maven-components/maven-core/src/test/java/org/apache/maven/project/helpers/ProjectTestHelper.java
  
  Index: ProjectTestHelper.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/project/helpers/ProjectTestHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProjectTestHelper.java	23 Jun 2004 15:16:18 -0000	1.3
  +++ ProjectTestHelper.java	23 Jun 2004 18:04:18 -0000	1.4
  @@ -17,13 +17,7 @@
    */
   
   import junit.framework.TestCase;
  -import org.apache.maven.model.Build;
  -import org.apache.maven.model.Contributor;
  -import org.apache.maven.model.Dependency;
  -import org.apache.maven.model.Developer;
  -import org.apache.maven.model.MailingList;
  -import org.apache.maven.model.Resource;
  -import org.apache.maven.model.UnitTest;
  +import org.apache.maven.model.*;
   import org.apache.maven.project.MavenProject;
   
   /**
  @@ -58,13 +52,25 @@
   
           assertEquals( "http://maven.apache.org/", project.getUrl() );
   
  -        assertEquals( "maven.apache.org", project.getSiteAddress() );
   
  -        assertEquals( "/www/maven.apache.org/", project.getSiteDirectory() );
   
           // ----------------------------------------------------------------------
           // Distribution
           // ----------------------------------------------------------------------
  +
  +        DistributionManagement distributionManagement = project.getDistributionManagement();
  +
  +        assertNotNull( distributionManagement   );
  +
  +        Site site = distributionManagement.getSite();
  +
  +        assertNotNull( site  );
  +
  +        Repository repository = distributionManagement.getRepository();
  +
  +        assertNotNull( repository  );
  +
  +
   
           // ----------------------------------------------------------------------
           // Organization
  
  
  

Mime
View raw message