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-artifact/src/main/java/org/apache/maven/artifact AbstractArtifactComponent.java DefaultArtifact.java
Date Tue, 08 Mar 2005 05:34:52 GMT
brett       2005/03/07 21:34:52

  Modified:    maven-core/src/main/java/org/apache/maven/artifact
                        MavenMetadataSource.java
               maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
               maven-core/src/main/java/org/apache/maven/project
                        MavenProject.java
               maven-model maven.mdo
               maven-artifact/src/main/java/org/apache/maven/artifact/resolver
                        DefaultArtifactResolver.java
               maven-artifact/src/main/java/org/apache/maven/artifact
                        AbstractArtifactComponent.java DefaultArtifact.java
  Added:       maven-core/src/test/java/org/apache/maven/project
                        ProjectClasspathArtifactResolver.java
                        ProjectClasspathTest.java
               maven-core/src/test/resources/org/apache/maven/project
                        ProjectClasspathTest.xml
               maven-core/src/test/resources/projects/scope
                        project-with-scoped-dependencies.xml
                        transitive-compile-dep.xml
                        transitive-default-dep.xml
                        transitive-runtime-dep.xml transitive-test-dep.xml
  Log:
  tests and repairs for scope
  
  Revision  Changes    Path
  1.13      +20 -7     maven-components/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java
  
  Index: MavenMetadataSource.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MavenMetadataSource.java	7 Mar 2005 09:41:55 -0000	1.12
  +++ MavenMetadataSource.java	8 Mar 2005 05:34:51 -0000	1.13
  @@ -79,12 +79,12 @@
               if ( mavenProjectBuilder != null )
               {
                   MavenProject project = mavenProjectBuilder.build( metadataArtifact.getFile(),
localRepository );
  -                artifacts = createArtifacts( project.getDependencies(), localRepository
);
  +                artifacts = createArtifacts( project.getDependencies(), artifact.getScope(),
localRepository );
               }
               else
               {
                   Model model = reader.read( new FileReader( metadataArtifact.getFile() )
);
  -                artifacts = createArtifacts( model.getDependencies(), localRepository );
  +                artifacts = createArtifacts( model.getDependencies(), artifact.getScope(),
localRepository );
               }
           }
           catch ( ArtifactResolutionException e )
  @@ -99,27 +99,40 @@
           return artifacts;
       }
   
  -    public Set createArtifacts( List dependencies, ArtifactRepository localRepository )
  +    protected Set createArtifacts( List dependencies, String scope, ArtifactRepository
localRepository )
       {
           Set projectArtifacts = new HashSet();
           for ( Iterator i = dependencies.iterator(); i.hasNext(); )
           {
               Dependency d = (Dependency) i.next();
  -            Artifact artifact = createArtifact( d, localRepository );
  +            Artifact artifact = createArtifact( d, scope, localRepository );
               projectArtifacts.add( artifact );
           }
           return projectArtifacts;
       }
   
  -    public Artifact createArtifact( Dependency dependency, ArtifactRepository localRepository
)
  +    protected Artifact createArtifact( Dependency dependency, String scope, ArtifactRepository
localRepository )
       {
           // TODO: duplicated with the ArtifactFactory, localRepository not used (should
be used here to resolve path?
           Artifact artifact = new DefaultArtifact( dependency.getGroupId(),
                                                    dependency.getArtifactId(),
                                                    dependency.getVersion(),
  -                                                 dependency.getScope(),
  +                                                 transitiveScope( dependency.getScope(),
scope ),
                                                    dependency.getType(),
                                                    dependency.getType() );
           return artifact;
       }
  +
  +    private String transitiveScope( String desiredScope, String artifactScope )
  +    {
  +        // TODO: scope handler
  +        if ( Artifact.SCOPE_TEST.equals( artifactScope ) || Artifact.SCOPE_TEST.equals(
desiredScope ) )
  +        {
  +            return Artifact.SCOPE_TEST;
  +        }
  +        else
  +        {
  +            return Artifact.SCOPE_RUNTIME;
  +        }
  +    }
   }
  
  
  
  1.42      +2 -1      maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- DefaultPluginManager.java	7 Mar 2005 19:03:18 -0000	1.41
  +++ DefaultPluginManager.java	8 Mar 2005 05:34:52 -0000	1.42
  @@ -209,7 +209,8 @@
   
               String version = "1.0-SNAPSHOT";
   
  -            Artifact pluginArtifact = new DefaultArtifact( "maven", artifactId, version,
"plugin", "jar" );
  +            Artifact pluginArtifact = new DefaultArtifact( "maven", artifactId, version,
DefaultArtifact.SCOPE_RUNTIME,
  +                                                           "plugin", "jar" );
   
               addPlugin( pluginArtifact, session );
           }
  
  
  
  1.24      +4 -6      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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- MavenProject.java	8 Mar 2005 01:51:20 -0000	1.23
  +++ MavenProject.java	8 Mar 2005 05:34:52 -0000	1.24
  @@ -177,7 +177,7 @@
               Artifact a = (Artifact) i.next();
   
               // TODO: let the scope handler deal with this
  -            if ( a.getScope() == null || Artifact.SCOPE_COMPILE.equals( a.getScope() )
)
  +            if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) )
               {
                   list.add( a.getPath() );
               }
  @@ -198,9 +198,8 @@
               if ( isAddedToClasspath( a ) )
               {
                   // TODO: let the scope handler deal with this
  -                if ( a.getScope() == null || Artifact.SCOPE_TEST.equals( a.getScope() )
||
  -                    Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
  -                    Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
  +                if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals(
a.getScope() ) || Artifact.SCOPE_RUNTIME.equals(
  +                    a.getScope() ) )
                   {
                       list.add( a.getPath() );
                   }
  @@ -222,8 +221,7 @@
               if ( isAddedToClasspath( a ) )
               {
                   // TODO: let the scope handler deal with this
  -                if ( a.getScope() == null || Artifact.SCOPE_COMPILE.equals( a.getScope()
) ||
  -                    Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
  +                if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals(
a.getScope() ) )
                   {
                       list.add( a.getPath() );
                   }
  
  
  
  1.1                  maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java
  
  Index: ProjectClasspathArtifactResolver.java
  ===================================================================
  package org.apache.maven.project;
  
  /*
   * Copyright 2001-2005 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import org.apache.maven.artifact.Artifact;
  import org.apache.maven.artifact.MavenMetadataSource;
  import org.apache.maven.artifact.handler.manager.ArtifactHandlerNotFoundException;
  import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
  import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
  import org.apache.maven.artifact.repository.ArtifactRepository;
  import org.apache.maven.artifact.resolver.ArtifactResolutionException;
  import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
  import org.apache.maven.artifact.resolver.ArtifactResolver;
  import org.apache.maven.artifact.resolver.DefaultArtifactResolver;
  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
  import org.apache.maven.model.Model;
  import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
  
  import java.io.InputStreamReader;
  import java.util.Set;
  
  public class ProjectClasspathArtifactResolver extends DefaultArtifactResolver
  {
      private static class Source extends MavenMetadataSource
      {
          public Source( ArtifactResolver artifactResolver )
          {
              super( artifactResolver );
          }
  
          public Set retrieve( Artifact artifact, ArtifactRepository localRepository, Set
remoteRepositories )
              throws ArtifactMetadataRetrievalException
          {
              MavenXpp3Reader reader = new MavenXpp3Reader();
              Model model = null;
              try
              {
                  String scope = artifact.getArtifactId().substring( "scope-".length() );
                  String name = "/projects/scope/transitive-" + scope + "-dep.xml";
                  model = reader.read( new InputStreamReader( getClass().getResourceAsStream(
name ) ) );
              }
              catch ( Exception e )
              {
                  throw new ArtifactMetadataRetrievalException( e );
              }
              return createArtifacts( model.getDependencies(), artifact.getScope(), localRepository
);
          }
      }
  
      public Artifact resolve( Artifact artifact, Set remoteRepositories, ArtifactRepository
localRepository )
          throws ArtifactResolutionException
      {
          return artifact;
      }
  
      protected void setLocalRepositoryPath( Artifact artifact, ArtifactRepository localRepository
)
          throws ArtifactHandlerNotFoundException
      {
      }
  
      public ArtifactResolutionResult resolveTransitively( Set artifacts, Set remoteRepositories,
                                                           ArtifactRepository localRepository,
                                                           ArtifactMetadataSource source,
ArtifactFilter filter )
          throws ArtifactResolutionException
      {
          return super.resolveTransitively( artifacts, remoteRepositories, localRepository,
new Source( this ), filter );
      }
  
      public ArtifactResolutionResult resolveTransitively( Set artifacts, Set remoteRepositories,
                                                           ArtifactRepository localRepository,
                                                           ArtifactMetadataSource source )
          throws ArtifactResolutionException
      {
          return super.resolveTransitively( artifacts, remoteRepositories, localRepository,
new Source( this ) );
      }
  
      public ArtifactResolutionResult resolveTransitively( Artifact artifact, Set remoteRepositories,
                                                           ArtifactRepository localRepository,
                                                           ArtifactMetadataSource source )
          throws ArtifactResolutionException
      {
          return super.resolveTransitively( artifact, remoteRepositories, localRepository,
new Source( this ) );
      }
  }
  
  
  
  1.1                  maven-components/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
  
  Index: ProjectClasspathTest.java
  ===================================================================
  package org.apache.maven.project;
  
  /*
   * Copyright 2001-2005 The Apache Software Foundation.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  import org.apache.maven.MavenTestCase;
  import org.apache.maven.artifact.Artifact;
  
  import java.io.File;
  import java.lang.reflect.Field;
  import java.util.Iterator;
  
  /**
   * @todo relocate to maven-artifact in entirety
   */
  public class ProjectClasspathTest extends MavenTestCase
  {
  
      private String dir = "src/test/resources/projects/scope/";
  
      public void testProjectClasspath()
          throws Exception
      {
          File f = getTestFile( dir + "project-with-scoped-dependencies.xml" );
  
          // XXX: Because this test fails, we resort to crude reflection hacks, see PLX-108
for the solution
  //        assertEquals( ProjectClasspathArtifactResolver.class.getName(), getContainer().lookup(
ArtifactResolver.ROLE ) );
          MavenProjectBuilder builder = (MavenProjectBuilder) getContainer().lookup( MavenProjectBuilder.ROLE
);
          Field declaredField = builder.getClass().getDeclaredField( "artifactResolver" );
          boolean acc = declaredField.isAccessible();
          declaredField.setAccessible( true );
          declaredField.set( builder, new ProjectClasspathArtifactResolver() );
          declaredField.setAccessible( acc );
          // XXX: end hack
  
          MavenProject project = getProject( f, true );
  
          Artifact artifact;
  
          assertNotNull( "Test project can't be null!", project );
  
          checkArtifactIdScope( project, "test", "test" );
          checkArtifactIdScope( project, "compile", "compile" );
          checkArtifactIdScope( project, "runtime", "runtime" );
          checkArtifactIdScope( project, "default", "compile" );
  
          // check all transitive deps of a test dependency are test scope
          checkGroupIdScope( project, "test", "test" );
  
          // check all transitive deps of a runtime dependency are runtime scope, except for
test
          checkGroupIdScope( project, "runtime", "runtime" );
  
          // check all transitive deps of a compile dependency are runtime scope, except for
test
          checkGroupIdScope( project, "compile", "runtime" );
  
          // check all transitive deps of a default dependency are runtime scope, except for
test
          checkGroupIdScope( project, "default", "runtime" );
      }
  
      private void checkGroupIdScope( MavenProject project, String scope, String scopeValue
)
      {
          Artifact artifact;
          String groupId = "maven-test-" + scope;
          artifact = getArtifact( project, groupId, "scope-compile" );
          assertEquals( "Check scope", scopeValue, artifact.getScope() );
          artifact = getArtifact( project, groupId, "scope-test" );
          assertEquals( "Check scope", "test", artifact.getScope() );
          artifact = getArtifact( project, groupId, "scope-default" );
          assertEquals( "Check scope", scopeValue, artifact.getScope() );
          artifact = getArtifact( project, groupId, "scope-runtime" );
          assertEquals( "Check scope", scopeValue, artifact.getScope() );
      }
  
      private void checkArtifactIdScope( MavenProject project, String scope, String scopeValue
)
      {
          String artifactId = "scope-" + scope;
          Artifact artifact = getArtifact( project, "maven-test", artifactId );
          assertEquals( "Check scope", scopeValue, artifact.getScope() );
      }
  
      private Artifact getArtifact( MavenProject project, String groupId, String artifactId
)
      {
          for ( Iterator i = project.getArtifacts().iterator(); i.hasNext(); )
          {
              Artifact a = (Artifact) i.next();
              if ( artifactId.equals( a.getArtifactId() ) && a.getGroupId().equals(
groupId ) )
              {
                  return a;
              }
          }
          fail( "Dependency " + artifactId + " not found" );
          return null;
      }
  }
  
  
  
  1.1                  maven-components/maven-core/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
  
  Index: ProjectClasspathTest.xml
  ===================================================================
  <plexus>
    <components>
      <component>
        <role>org.apache.maven.artifact.ArtifactResolver</role>
        <implementation>org.apache.maven.project.ProjectClasspathArtifactResolver</implementation>
      </component>
    </components>
  </plexus>
  
  
  1.1                  maven-components/maven-core/src/test/resources/projects/scope/project-with-scoped-dependencies.xml
  
  Index: project-with-scoped-dependencies.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <groupId>maven</groupId>
    <artifactId>maven-project-test</artifactId>
    <name>Maven</name>
    <version>1.0-beta-9</version>
    <dependencies>
  
      <dependency>
        <groupId>maven-test</groupId>
        <artifactId>scope-default</artifactId>
        <version>1.0</version>
      </dependency>
  
      <dependency>
        <groupId>maven-test</groupId>
        <artifactId>scope-test</artifactId>
        <version>1.0</version>
        <scope>test</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test</groupId>
        <artifactId>scope-runtime</artifactId>
        <version>1.0</version>
        <scope>runtime</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test</groupId>
        <artifactId>scope-compile</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
      </dependency>
  
    </dependencies>
  
  </project>
  
  
  
  1.1                  maven-components/maven-core/src/test/resources/projects/scope/transitive-compile-dep.xml
  
  Index: transitive-compile-dep.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <groupId>maven-test</groupId>
    <artifactId>scope-compile</artifactId>
    <version>1.0</version>
    <dependencies>
  
      <dependency>
        <groupId>maven-test-compile</groupId>
        <artifactId>scope-default</artifactId>
        <version>1.0</version>
      </dependency>
  
      <dependency>
        <groupId>maven-test-compile</groupId>
        <artifactId>scope-test</artifactId>
        <version>1.0</version>
        <scope>test</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-compile</groupId>
        <artifactId>scope-runtime</artifactId>
        <version>1.0</version>
        <scope>runtime</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-compile</groupId>
        <artifactId>scope-compile</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
      </dependency>
  
    </dependencies>
  
  </project>
  
  
  
  1.1                  maven-components/maven-core/src/test/resources/projects/scope/transitive-default-dep.xml
  
  Index: transitive-default-dep.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <groupId>maven-test</groupId>
    <artifactId>scope-default</artifactId>
    <version>1.0</version>
    <dependencies>
  
      <dependency>
        <groupId>maven-test-default</groupId>
        <artifactId>scope-default</artifactId>
        <version>1.0</version>
      </dependency>
  
      <dependency>
        <groupId>maven-test-default</groupId>
        <artifactId>scope-test</artifactId>
        <version>1.0</version>
        <scope>test</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-default</groupId>
        <artifactId>scope-runtime</artifactId>
        <version>1.0</version>
        <scope>runtime</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-default</groupId>
        <artifactId>scope-compile</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
      </dependency>
  
    </dependencies>
  
  </project>
  
  
  
  1.1                  maven-components/maven-core/src/test/resources/projects/scope/transitive-runtime-dep.xml
  
  Index: transitive-runtime-dep.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <groupId>maven-test</groupId>
    <artifactId>scope-runtime</artifactId>
    <version>1.0</version>
    <dependencies>
  
      <dependency>
        <groupId>maven-test-runtime</groupId>
        <artifactId>scope-default</artifactId>
        <version>1.0</version>
      </dependency>
  
      <dependency>
        <groupId>maven-test-runtime</groupId>
        <artifactId>scope-test</artifactId>
        <version>1.0</version>
        <scope>test</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-runtime</groupId>
        <artifactId>scope-runtime</artifactId>
        <version>1.0</version>
        <scope>runtime</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-runtime</groupId>
        <artifactId>scope-compile</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
      </dependency>
  
    </dependencies>
  
  </project>
  
  
  
  1.1                  maven-components/maven-core/src/test/resources/projects/scope/transitive-test-dep.xml
  
  Index: transitive-test-dep.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <groupId>maven-test</groupId>
    <artifactId>scope-test</artifactId>
    <version>1.0</version>
    <dependencies>
  
      <dependency>
        <groupId>maven-test-test</groupId>
        <artifactId>scope-default</artifactId>
        <version>1.0</version>
      </dependency>
  
      <dependency>
        <groupId>maven-test-test</groupId>
        <artifactId>scope-test</artifactId>
        <version>1.0</version>
        <scope>test</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-test</groupId>
        <artifactId>scope-runtime</artifactId>
        <version>1.0</version>
        <scope>runtime</scope>
      </dependency>
  
      <dependency>
        <groupId>maven-test-test</groupId>
        <artifactId>scope-compile</artifactId>
        <version>1.0</version>
        <scope>compile</scope>
      </dependency>
  
    </dependencies>
  
  </project>
  
  
  
  1.82      +1 -3      maven-components/maven-model/maven.mdo
  
  Index: maven.mdo
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- maven.mdo	7 Mar 2005 23:02:43 -0000	1.81
  +++ maven.mdo	8 Mar 2005 05:34:52 -0000	1.82
  @@ -807,9 +807,7 @@
             <version>4.0.0</version>
             <description>The scope of the dependency - build, compile, test, runtime</description>
             <type>String</type>
  -<!-- TODO: set default value? see DefaultArtifact first
  -          <defaultValue>runtime</defaultValue>
  --->
  +          <defaultValue>compile</defaultValue>
           </field>
         </fields>
         <codeSegments>
  
  
  
  1.14      +5 -6      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
  
  Index: DefaultArtifactResolver.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultArtifactResolver.java	7 Mar 2005 09:41:54 -0000	1.13
  +++ DefaultArtifactResolver.java	8 Mar 2005 05:34:52 -0000	1.14
  @@ -11,6 +11,7 @@
   import org.apache.maven.artifact.resolver.transform.ArtifactRequestTransformation;
   import org.apache.maven.wagon.TransferFailedException;
   
  +import java.util.Collections;
   import java.util.HashMap;
   import java.util.HashSet;
   import java.util.Iterator;
  @@ -19,6 +20,9 @@
   import java.util.Map;
   import java.util.Set;
   
  +/**
  + * @todo get rid of {@link AbstractArtifactComponent} and then create an AbstractArtifactResolver
that does the transitive boilerplate
  + */
   public class DefaultArtifactResolver
       extends AbstractArtifactComponent
       implements ArtifactResolver
  @@ -175,11 +179,7 @@
                                                            ArtifactMetadataSource source
)
           throws ArtifactResolutionException
       {
  -        Set s = new HashSet();
  -
  -        s.add( artifact );
  -
  -        return resolveTransitively( s, remoteRepositories, localRepository, source );
  +        return resolveTransitively( Collections.singleton( artifact ), remoteRepositories,
localRepository, source );
       }
   
   
  @@ -242,7 +242,6 @@
   
                       try
                       {
  -                        // TODO: need to convert scope compile -> runtime using scope
handler
                           referencedDependencies = source.retrieve( newArtifact, localRepository,
remoteRepositories );
                       }
                       catch ( ArtifactMetadataRetrievalException e )
  
  
  
  1.4       +2 -1      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/AbstractArtifactComponent.java
  
  Index: AbstractArtifactComponent.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/AbstractArtifactComponent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AbstractArtifactComponent.java	1 Mar 2005 04:04:25 -0000	1.3
  +++ AbstractArtifactComponent.java	8 Mar 2005 05:34:52 -0000	1.4
  @@ -23,6 +23,7 @@
   import org.codehaus.plexus.logging.AbstractLogEnabled;
   
   /**
  + * @todo refactor away
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
    * @version $Id$
    */
  
  
  
  1.7       +1 -2      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
  
  Index: DefaultArtifact.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultArtifact.java	7 Mar 2005 23:02:43 -0000	1.6
  +++ DefaultArtifact.java	8 Mar 2005 05:34:52 -0000	1.7
  @@ -57,7 +57,6 @@
       /** @todo this should be replaced by type handler */
       public DefaultArtifact( String groupId, String artifactId, String version, String type,
String extension )
       {
  -        // TODO: default should be runtime, except in currently building POM where it is
compile.
           this( groupId, artifactId, version, SCOPE_COMPILE, type, extension );
       }
   
  
  
  

Mime
View raw message