archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Erdfelt <joa...@erdfelt.com>
Subject Re: svn commit: r634361 - in /maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src: main/java/org/apache/maven/archiva/repository/project/filters/ test/java/org/apache/maven/archiva/repository/project/filters/ test/repositories/de...
Date Fri, 07 Mar 2008 00:20:39 GMT
I'm working on it.

At first I lost the ability to resolve svn.apache.org, then I hit the 
appassembler issues.
It'll make it in.

- Joakim

Brett Porter wrote:
> Don't forget to merge to trunk :)
>
> On 07/03/2008, at 4:40 AM, joakime@apache.org wrote:
>
>> Author: joakime
>> Date: Thu Mar  6 09:40:26 2008
>> New Revision: 634361
>>
>> URL: http://svn.apache.org/viewvc?rev=634361&view=rev
>> Log:
>> [MRM-731] variable in url pom are not replaced.
>> * Added test case outlined in JIRA.
>> * Fixed filter for ${pom.*} and ${project.*} expression expansion.
>>
>>
>> Modified:
>>    
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java

>>
>>    
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java

>>
>>    
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom

>>
>>
>> Modified: 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java

>>
>> URL: 
>> http://svn.apache.org/viewvc/maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java?rev=634361&r1=634360&r2=634361&view=diff

>>
>> ============================================================================== 
>>
>> --- 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java

>> (original)
>> +++ 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java

>> Thu Mar  6 09:40:26 2008
>> @@ -104,11 +104,23 @@
>>             try
>>             {
>>                 // Setup some common properties.
>> -                props.setProperty( "pom.groupId", 
>> StringUtils.defaultString( evaluator.expand( model.getGroupId() ) ) );
>> -                props.setProperty( "pom.artifactId", 
>> StringUtils.defaultString( evaluator
>> -                    .expand( model.getArtifactId() ) ) );
>> -                props.setProperty( "pom.version", 
>> StringUtils.defaultString( evaluator.expand( model.getVersion() ) ) );
>> -                props.setProperty( "pom.name", 
>> StringUtils.defaultString( evaluator.expand( model.getName() ) ) );
>> +                String groupId = StringUtils.defaultString( 
>> evaluator.expand( model.getGroupId() ) );
>> +                String artifactId = StringUtils.defaultString( 
>> evaluator.expand( model.getArtifactId() ) );
>> +                String version = StringUtils.defaultString( 
>> evaluator.expand( model.getVersion() ) );
>> +                String name = StringUtils.defaultString( 
>> evaluator.expand( model.getName() ) );
>> +
>> +                /* Archiva doesn't need to handle a full expression 
>> language with object tree walking
>> +                 * as the requirements within Archiva are much 
>> smaller, a quick replacement of the
>> +                 * important fields (groupId, artifactId, version, 
>> name) are handled specifically.
>> +                 */
>> +                props.setProperty( "pom.groupId",  groupId );
>> +                props.setProperty( "pom.artifactId", artifactId );
>> +                props.setProperty( "pom.version", version );
>> +                props.setProperty( "pom.name", name );
>> +                props.setProperty( "project.groupId",  groupId );
>> +                props.setProperty( "project.artifactId", artifactId );
>> +                props.setProperty( "project.version", version );
>> +                props.setProperty( "project.name", name );
>>
>>                 // Evaluate everything.
>>                 ret.setVersion( evaluator.expand( ret.getVersion() ) );
>>
>> Modified: 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java

>>
>> URL: 
>> http://svn.apache.org/viewvc/maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java?rev=634361&r1=634360&r2=634361&view=diff

>>
>> ============================================================================== 
>>
>> --- 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java

>> (original)
>> +++ 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java

>> Thu Mar  6 09:40:26 2008
>> @@ -91,7 +91,7 @@
>>             assertEquals( "Dependency [" + dep.getArtifactId() + "] 
>> Version", "1.0-SNAPSHOT", dep.getVersion() );
>>         }
>>     }
>> -
>> +
>>     /**
>>      * [MRM-487] pom version is not resolved
>>      * [MRM-488] properties in pom are not resolved (at least while 
>> browsing)
>> @@ -112,10 +112,16 @@
>>         String evaluatedModelText = toModelText( filteredModel );
>>
>>         // Test xml buffer for the existance of an unevaluated 
>> expression.
>> +        boolean foundUnevaluated = false;
>>         if ( evaluatedModelText.indexOf( "${" ) != ( -1 ) )
>>         {
>>             System.err.println( "Found Expression:\n" + 
>> evaluatedModelText );
>> -            fail( "Found Unevaluated Expression. (see System.err)" );
>> +            foundUnevaluated = true;
>> +        }
>> +
>> +        if ( foundUnevaluated )
>> +        {
>> +            fail( "Found Unevaluated Expression. (see System.err for 
>> details)" );
>>         }
>>     }
>>
>>
>> Modified: 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom

>>
>> URL: 
>> http://svn.apache.org/viewvc/maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom?rev=634361&r1=634360&r2=634361&view=diff

>>
>> ============================================================================== 
>>
>> --- 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom

>> (original)
>> +++ 
>> maven/archiva/branches/archiva-1.0.x/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom

>> Thu Mar  6 09:40:26 2008
>> @@ -102,7 +102,8 @@
>>         <prj.confluence.path>TEST/Archiva</prj.confluence.path>
>>     </properties>
>>
>> -    <url>${kb.site.url}/${prj.url.relative}</url>
>> +    <!-- MRM-731 : variable in url pom are not replaced. -->
>> +    
>> <url>http://j.random.server.com/docs/${project.groupId}/${project.artifactId}/${project.version}</url>

>>
>>
>>     <scm>
>>         <connection>scm:svn:${prj.svn}/${prj.svn.branch}</connection>
>>
>>
>
> -- 
> Brett Porter
> brett@apache.org
> http://blogs.exist.com/bporter/
>


-- 
- Joakim Erdfelt
  joakim@erdfelt.com
  Open Source Software (OSS) Developer


Mime
View raw message