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-model maven.mdo
Date Mon, 07 Mar 2005 08:15:26 GMT
brett       2005/03/07 00:15:26

  Modified:    maven-core/src/main/java/org/apache/maven/project/injection
                        DefaultModelDefaultsInjector.java
               maven-core/src/main/java/org/apache/maven/project/path
                        DefaultPathTranslator.java
               maven-core/src/test/java/org/apache/maven/project
                        ProjectBaseDirectoryAlignmentTest.java
               maven-core/src/test/java/org/apache/maven/project/injection
                        DefaultModelDefaultsInjectorTest.java
               maven-core/src/test/resources/projects/base-directory-alignment
                        project-which-needs-directory-alignment.xml
               maven-model maven.mdo
  Log:
  remove <file>, add <scope>
  
  Revision  Changes    Path
  1.3       +5 -5      maven-components/maven-core/src/main/java/org/apache/maven/project/injection/DefaultModelDefaultsInjector.java
  
  Index: DefaultModelDefaultsInjector.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/injection/DefaultModelDefaultsInjector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultModelDefaultsInjector.java	24 Feb 2005 04:16:18 -0000	1.2
  +++ DefaultModelDefaultsInjector.java	7 Mar 2005 08:15:25 -0000	1.3
  @@ -77,14 +77,14 @@
        */
       private void mergeWithDefaults( Dependency dep, Dependency def )
       {
  -        if ( dep.getVersion() == null && def.getVersion() != null )
  +        if ( dep.getScope() == null && def.getScope() != null )
           {
  -            dep.setVersion( def.getVersion() );
  +            dep.setScope( def.getScope() );
           }
   
  -        if ( dep.getFile() == null && def.getFile() != null )
  +        if ( dep.getVersion() == null && def.getVersion() != null )
           {
  -            dep.setFile( def.getFile() );
  +            dep.setVersion( def.getVersion() );
           }
   
           Properties props = new Properties( def.getProperties() );
  @@ -92,4 +92,4 @@
           dep.setProperties( props );
       }
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.7       +0 -19     maven-components/maven-core/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java
  
  Index: DefaultPathTranslator.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/project/path/DefaultPathTranslator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultPathTranslator.java	24 Feb 2005 04:37:54 -0000	1.6
  +++ DefaultPathTranslator.java	7 Mar 2005 08:15:26 -0000	1.7
  @@ -96,25 +96,6 @@
                   }
               }
   
  -            List dependencies = model.getDependencies();
  -
  -            for ( Iterator i = dependencies.iterator(); i.hasNext(); )
  -            {
  -                Dependency dependency = (Dependency) i.next();
  -
  -                s = dependency.getFile();
  -
  -                if ( s != null )
  -                {
  -                    s = stripBasedirToken( s );
  -
  -                    if ( requiresBaseDirectoryAlignment( s ) )
  -                    {
  -                        dependency.setFile( new File( projectFile.getParentFile(), s ).getPath()
);
  -                    }
  -                }
  -            }
  -
               s = stripBasedirToken( build.getOutput() );
   
               if ( requiresBaseDirectoryAlignment( s ) )
  
  
  
  1.8       +0 -28     maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectBaseDirectoryAlignmentTest.java
  
  Index: ProjectBaseDirectoryAlignmentTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectBaseDirectoryAlignmentTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ProjectBaseDirectoryAlignmentTest.java	24 Feb 2005 04:37:54 -0000	1.7
  +++ ProjectBaseDirectoryAlignmentTest.java	7 Mar 2005 08:15:26 -0000	1.8
  @@ -32,33 +32,5 @@
           Resource resource = (Resource) build.getResources().get( 0 );
   
           assertTrue( resource.getDirectory().startsWith( getBasedir() ) );
  -
  -        String relativeFile = null;
  -        String absoluteFile = null;
  -        String managedDependencyFile = null;
  -        for ( Iterator i = project.getDependencies().iterator(); i.hasNext(); )
  -        {
  -            Dependency d = (Dependency) i.next();
  -            if ( d.getGroupId().equals( "g1" ) )
  -            {
  -                relativeFile = d.getFile();
  -            }
  -            else if ( d.getGroupId().equals( "g2" ) )
  -            {
  -                absoluteFile = d.getFile();
  -            }
  -            else if ( d.getGroupId().equals( "g3" ) )
  -            {
  -                managedDependencyFile = d.getFile();
  -            }
  -        }
  -
  -        assertNotNull( "Required dependency missing: g1:d1", relativeFile );
  -        assertNotNull( "Required dependency missing: g2:d2", absoluteFile );
  -        assertNotNull( "Required dependency missing: g3:d3", managedDependencyFile );
  -
  -        assertTrue( "Relative file not adjusted", relativeFile.startsWith( getBasedir()
) );
  -        assertEquals( "Absolute file was incorrectly modified", "/top/level/path", absoluteFile
);
  -        assertTrue( "Managed dependency not adjusted", managedDependencyFile.startsWith(
getBasedir() ) );
       }
   }
  
  
  
  1.2       +8 -8      maven-components/maven-core/src/test/java/org/apache/maven/project/injection/DefaultModelDefaultsInjectorTest.java
  
  Index: DefaultModelDefaultsInjectorTest.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/java/org/apache/maven/project/injection/DefaultModelDefaultsInjectorTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultModelDefaultsInjectorTest.java	24 Feb 2005 04:21:52 -0000	1.1
  +++ DefaultModelDefaultsInjectorTest.java	7 Mar 2005 08:15:26 -0000	1.2
  @@ -50,7 +50,7 @@
           def.setGroupId( dep.getGroupId() );
           def.setArtifactId( dep.getArtifactId() );
           def.setVersion( "1.0.1" );
  -        def.setFile( "file" );
  +        def.setScope( "scope" );
   
           DependencyManagement depMgmt = new DependencyManagement();
   
  @@ -203,7 +203,7 @@
           assertEquals( "value", result.getProperties().getProperty( "test" ) );
       }
   
  -    public void testShouldMergeDefaultFileWhenDependencyDoesntSupplyFile()
  +    public void testShouldMergeDefaultScopeWhenDependencyDoesntSupplyScope()
       {
           Model model = new Model();
   
  @@ -211,7 +211,7 @@
           dep.setGroupId( "myGroup" );
           dep.setArtifactId( "myArtifact" );
           dep.setVersion( "1.0.1" );
  -        dep.setFile( "file" );
  +        dep.setScope( "scope" );
   
           model.addDependency( dep );
   
  @@ -232,10 +232,10 @@
   
           Dependency result = (Dependency) deps.get( 0 );
   
  -        assertEquals( "file", result.getFile() );
  +        assertEquals( "scope", result.getScope() );
       }
   
  -    public void testShouldNotMergeDefaultFileWhenDependencySuppliesFile()
  +    public void testShouldNotMergeDefaultScopeWhenDependencySuppliesScope()
       {
           Model model = new Model();
   
  @@ -243,14 +243,14 @@
           dep.setGroupId( "myGroup" );
           dep.setArtifactId( "myArtifact" );
           dep.setVersion( "1.0.1" );
  -        dep.setFile( "file" );
  +        dep.setScope( "scope" );
   
           model.addDependency( dep );
   
           Dependency def = new Dependency();
           def.setGroupId( dep.getGroupId() );
           def.setArtifactId( dep.getArtifactId() );
  -        def.setFile( "default" );
  +        def.setScope( "default" );
   
           DependencyManagement depMgmt = new DependencyManagement();
   
  @@ -264,7 +264,7 @@
           assertEquals( 1, deps.size() );
   
           Dependency result = (Dependency) deps.get( 0 );
  -        assertEquals( "file", result.getFile() );
  +        assertEquals( "scope", result.getScope() );
       }
   
       public void testShouldRejectDependencyWhereNoVersionIsFoundAfterDefaultsInjection()
  
  
  
  1.4       +0 -3      maven-components/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml
  
  Index: project-which-needs-directory-alignment.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project-which-needs-directory-alignment.xml	24 Feb 2005 04:37:54 -0000	1.3
  +++ project-which-needs-directory-alignment.xml	7 Mar 2005 08:15:26 -0000	1.4
  @@ -64,7 +64,6 @@
         <artifactId>d1</artifactId>
         <version>1.0</version>
         <url>d1-url</url>
  -      <file>foo/bar</file>
       </dependency>
   
       <dependency>
  @@ -72,7 +71,6 @@
         <artifactId>d2</artifactId>
         <version>2.0</version>
         <url>d2-url</url>
  -      <file>/top/level/path</file>
       </dependency>
   
       <dependency>
  @@ -89,7 +87,6 @@
           <artifactId>d3</artifactId>
           <version>3.0</version>
           <url>d3-url</url>
  -        <file>g3/d3</file>
         </dependency>      
       </dependencies>
     </dependencyManagement>
  
  
  
  1.78      +4 -2      maven-components/maven-model/maven.mdo
  
  Index: maven.mdo
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- maven.mdo	7 Mar 2005 05:02:31 -0000	1.77
  +++ maven.mdo	7 Mar 2005 08:15:26 -0000	1.78
  @@ -18,6 +18,8 @@
    | o need to clean up all the descriptions, matching anything to the current project-descriptor.xml
file and
    |   improving on that
    |
  + | o use enums where appropriate (eg dependency scope)
  + |
    -->
   <model>
     <id>maven</id>
  @@ -808,9 +810,9 @@
             </association>
           </field>
           <field>
  -          <name>file</name>
  +          <name>scope</name>
             <version>4.0.0</version>
  -          <description>Override the use of a repository - retrieve it from this file</description>
  +          <description>The scope of the dependency - build, compile, test, runtime</description>
             <type>String</type>
           </field>
         </fields>
  
  
  

Mime
View raw message