archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maria Odea Ching" <och...@apache.org>
Subject Re: svn commit: r610753 - in /maven/archiva/trunk/archiva-base: archiva-configuration/ archiva-configuration/src/main/mdo/ archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ archiva-repository-layer/src/main/java/org/apache/m
Date Fri, 11 Jan 2008 08:57:24 GMT
Hi again Nicolas,

There seems to be a class in archiva-webapp module which uses the
getArtifactReference() in LegacyPathArtifact that you removed from
configuration.mdo. Could you roll back the changes please? or update the
webapp module? :)

Thanks,
Deng

On Jan 10, 2008 6:54 PM, <nicolas@apache.org> wrote:

> Author: nicolas
> Date: Thu Jan 10 02:54:32 2008
> New Revision: 610753
>
> URL: http://svn.apache.org/viewvc?rev=610753&view=rev
> Log:
> remove dependency between archiva-configuration and archiva-model
>
> Modified:
>    maven/archiva/trunk/archiva-base/archiva-configuration/pom.xml
>
>  maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
>
>  maven/archiva/trunk/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java
>
>  maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
>
> Modified: maven/archiva/trunk/archiva-base/archiva-configuration/pom.xml
> URL:
> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/pom.xml?rev=610753&r1=610752&r2=610753&view=diff
>
> ==============================================================================
> --- maven/archiva/trunk/archiva-base/archiva-configuration/pom.xml
> (original)
> +++ maven/archiva/trunk/archiva-base/archiva-configuration/pom.xml Thu Jan
> 10 02:54:32 2008
> @@ -37,10 +37,6 @@
>       <artifactId>archiva-policies</artifactId>
>     </dependency>
>     <dependency>
> -      <groupId>org.apache.maven.archiva</groupId>
> -      <artifactId>archiva-model</artifactId>
> -    </dependency>
> -    <dependency>
>       <groupId>org.codehaus.plexus</groupId>
>       <artifactId>plexus-component-api</artifactId>
>     </dependency>
>
> Modified:
> maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
> URL:
> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo?rev=610753&r1=610752&r2=610753&view=diff
>
> ==============================================================================
> ---
> maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
> (original)
> +++
> maven/archiva/trunk/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
> Thu Jan 10 02:54:32 2008
> @@ -473,19 +473,30 @@
>         return path.equals( this.path );
>     }
>
> -    public org.apache.maven.archiva.model.ArtifactReferencegetArtifactReference()
> +    public String getGroupId()
>     {
> -        org.apache.maven.archiva.model.ArtifactReference reference = new
> org.apache.maven.archiva.model.ArtifactReference();
> -        String[] parts = artifact.split( ":" );
> -        reference.setGroupId( parts[0] );
> -        reference.setArtifactId( parts[1] );
> -        reference.setVersion( parts[2] );
> -        if ( parts[3].length() > 0 )
> -        {
> -            reference.setClassifier( parts[3] );
> -        }
> -        reference.setType( parts[4] );
> -        return reference;
> +        return artifact.split( ":" )[0];
> +       }
> +
> +    public String getArtifactId()
> +    {
> +        return artifact.split( ":" )[1];
> +       }
> +
> +    public String getVersion()
> +    {
> +        return artifact.split( ":" )[2];
> +       }
> +
> +    public String getClassifier()
> +    {
> +               String classifier = artifact.split( ":" )[3];
> +        return classifier.length() > 0 ? classifier : null;
> +       }
> +
> +    public String getType()
> +    {
> +        return artifact.split( ":" )[4];
>     }
>        ]]></code>
>         </codeSegment>
>
> Modified:
> maven/archiva/trunk/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java
> URL:
> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java?rev=610753&r1=610752&r2=610753&view=diff
>
> ==============================================================================
> ---
> maven/archiva/trunk/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java
> (original)
> +++
> maven/archiva/trunk/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java
> Thu Jan 10 02:54:32 2008
> @@ -2,8 +2,6 @@
>
>  import junit.framework.TestCase;
>
> -import org.apache.maven.archiva.model.ArtifactReference;
> -
>  /*
>  * Licensed to the Apache Software Foundation (ASF) under one
>  * or more contributor license agreements.  See the NOTICE file
> @@ -37,12 +35,11 @@
>     {
>         legacyArtifactPath.setArtifact(
> "groupId:artifactId:version:classifier:type" );
>
> -        ArtifactReference artifact =
> legacyArtifactPath.getArtifactReference();
> -        assertEquals( "groupId", artifact.getGroupId() );
> -        assertEquals( "artifactId", artifact.getArtifactId() );
> -        assertEquals( "version", artifact.getVersion() );
> -        assertEquals( "classifier", artifact.getClassifier() );
> -        assertEquals( "type", artifact.getType() );
> +        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
> +        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
> +        assertEquals( "version", legacyArtifactPath.getVersion() );
> +        assertEquals( "classifier", legacyArtifactPath.getClassifier() );
> +        assertEquals( "type", legacyArtifactPath.getType() );
>     }
>
>
> @@ -50,11 +47,10 @@
>     {
>         legacyArtifactPath.setArtifact( "groupId:artifactId:version::type"
> );
>
> -        ArtifactReference artifact =
> legacyArtifactPath.getArtifactReference();
> -        assertEquals( "groupId", artifact.getGroupId() );
> -        assertEquals( "artifactId", artifact.getArtifactId() );
> -        assertEquals( "version", artifact.getVersion() );
> -        assertEquals( null, artifact.getClassifier() );
> -        assertEquals( "type", artifact.getType() );
> +        assertEquals( "groupId", legacyArtifactPath.getGroupId() );
> +        assertEquals( "artifactId", legacyArtifactPath.getArtifactId() );
> +        assertEquals( "version", legacyArtifactPath.getVersion() );
> +        assertNull( legacyArtifactPath.getClassifier() );
> +        assertEquals( "type", legacyArtifactPath.getType() );
>     }
>  }
>
> Modified:
> maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
> URL:
> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java?rev=610753&r1=610752&r2=610753&view=diff
>
> ==============================================================================
> ---
> maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
> (original)
> +++
> maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
> Thu Jan 10 02:54:32 2008
> @@ -56,18 +56,23 @@
>     public ArtifactReference toArtifactReference( String path )
>         throws LayoutException
>     {
> +        ArtifactReference artifact = new ArtifactReference();
> +
>         // First, look if a custom resolution rule has been set for this
> artifact
>         Collection legacy = configuration.getConfiguration
> ().getLegacyArtifactPaths();
>         for ( Iterator iterator = legacy.iterator(); iterator.hasNext(); )
>         {
>             LegacyArtifactPath legacyPath = (LegacyArtifactPath)
> iterator.next();
>             if ( legacyPath.match( path ) )
> -            {
> -                return legacyPath.getArtifactReference();
> +            {
> +                           artifact.setGroupId( legacyPath.getGroupId()
> );
> +                           artifact.setArtifactId(
> legacyPath.getArtifactId() );
> +                           artifact.setClassifier(
> legacyPath.getClassifier() );
> +                           artifact.setVersion( legacyPath.getVersion()
> );
> +                           artifact.setType( legacyPath.getType() );
> +                return artifact;
>             }
>         }
> -
> -        ArtifactReference artifact = new ArtifactReference();
>
>         String normalizedPath = StringUtils.replace( path, "\\", "/" );
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message