[ 
http://jira.codehaus.org/browse/MRM-596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_114009
 ] 

nicolas de loof edited comment on MRM-596 at 11/16/07 2:33 AM:
---------------------------------------------------------------

The attached patch must be applied on archiva-repository-layer

it also require to :
- rename {{\src\test\repositories\legacy-repository\org.apache.maven\javadocs}} 
to {{javadoc.jars}} (in conformance to maven 1 javadoc plugin)
- move 
{{\src\test\repositories\legacy-repository\org.apache.maven\jars\testing-1.0-sources.jar}}
 to {{\src\test\repositories\legacy-repository\org.apache.maven\java-sources}} 
(in conformance to maven 1 source plugin).

Those two changes where not handled by my patch tool, as configured to binary 
types.

The idea of the patch is :
- remove the assertion that legacy path have no classifier. Simply have no way 
to support unstandard classifiers.
- automatically use "-javadoc" and "-sources" classifiers for path with types 
"javadoc.jars" and "java-sources". Check for the classifier to be detected in 
the version string and remove it.

The patch contains 
- modified code base
- updated test cases. Thanks to Joakim, this part has good test coverage and 
new tests are easy to add.


This will be easy in future to add support for other  m1 "standard" types to 
classifier conversion. Typically for ejb-client jars (not sure what the correct 
classifier is)


 was:
The attached patch must be applied on archiva-repository-layer

it also require to rename : 
\src\test\repositories\legacy-repository\org.apache.maven\javadocs to 
javadoc.jars (@see maven 1 javadoc plugin)
and to move 
\src\test\repositories\legacy-repository\org.apache.maven\jars\testing-1.0-sources.jar
 to \src\test\repositories\legacy-repository\org.apache.maven\java-sources 
(@see maven 1 source plugin).

Thos two changes where not handled by my patch tool, as configured to binary 
types.

The idea of the patch is :
- remove the assertion that legacy path have no classifier. Simply have no way 
to support unstandard classifiers.
- automatically use "-javadoc" and "-sources" classifiers for path with types 
"javadoc.jars" and "java-sources". Check for the classifier to be detected in 
the version string and remove it.

The patch contains 
- modified code base
- updated test cases. Thanks to Joakim, this part has good test coverage and 
new tests are easy to add.


> regression : cannot get java-sources anymore from maven1
> --------------------------------------------------------
>
>                 Key: MRM-596
>                 URL: http://jira.codehaus.org/browse/MRM-596
>             Project: Archiva
>          Issue Type: Bug
>          Components: WebDAV interface
>    Affects Versions: 1.0-beta-4
>            Reporter: nicolas de loof
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: MRM-596.patch
>
>
> requesting "junit/java-sources/junit-3.8.1-sources.jar" fails.
> Path is converted internally to 
> groupId = junit
> artifactId = junit
> version = 3.8.1-sources
> type = jar
> I can publish a fix for this, but my workspace contains other modified code 
> and I can hardly create a dedicated patch.
> The idea is to create a ArtifactClassifierMapping similar to existing 
> ArtifactExtensionMapping, and to use it in LegacyPathParser :
> {quote}
>             // Sanity Check: does extension match pathType on path?
>             String trimPathType = expectedType.substring( 0, 
> expectedType.length() - 1 );
>             String expectedExtension = ArtifactExtensionMapping.getExtension( 
> trimPathType );
> {color:red} 
>             artifact.setType( expectedExtension );
>             String classifier = ArtifactClassifierMapping.getClassifier( 
> trimPathType );
>             if ( classifier != null )
>             {
>                String version = artifact.getVersion();
>                 if ( ! version.endsWith( "-" + classifier ) )
>                 {
>                     throw new LayoutException( INVALID_ARTIFACT_PATH + 
> expectedType + " artifacts must use the classifier " + classifier );
>                 }
>                 version = version.substring( 0, version.length() - 
> classifier.length() - 1 );
>                 artifact.setVersion( version );
>                 artifact.setClassifier( classifier );
>             }
> {color}
> {quote}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to