[ 
http://jira.codehaus.org/browse/MRM-153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

nicolas de loof reopened MRM-153:
---------------------------------


This feature is broken by the use of DAV repository in place of the original 
"/proxy" path.

in ProxiedDavServer :
if ( WebdavMethodUtil.isReadMethod( request.getRequest().getMethod() ) )
        {
            if ( !hasResource( request.getLogicalResource() ) )
            {
                fetchContentFromProxies( request );
            }
        }
        davServer.process( request, response );

> The relocation is handled in fetchContentFromProxies( request ); but the 
> relocated path is not reported in the request

The request can be updated, but this requires to convert the File object into a 
path in the managed repository. I solved this by using :

            File file = proxyRequestHandler.get( request.getLogicalResource(), 
this.proxiedRepositories, this.managedRepository,
                                     this.wagonProxy );
            File baseDir = new File( this.managedRepository.getBasedir() );
            String path = file.getAbsolutePath().substring( 
baseDir.getAbsolutePath().length() );
            request.getRequest().setPathInfo( path );

... but those absolutePath.substring don't look very clean. Is there any other 
way to compute this Path from the File object and the managedRepository ? An 
alternative would be to return a "RepositoryEntry" in place of a File, that 
would contain both File and path.

> when used as a maven1 proxy, Archiva should handle relocation from maven2 poms
> ------------------------------------------------------------------------------
>
>                 Key: MRM-153
>                 URL: http://jira.codehaus.org/browse/MRM-153
>             Project: Archiva
>          Issue Type: Improvement
>         Environment: Archiva as a repository proxy for maven1
>            Reporter: nicolas de loof
>         Assigned To: Brett Porter
>            Priority: Minor
>             Fix For: 1.0
>
>         Attachments: DefaultProxyManager.java.patch, 
> DefaultProxyManager.java.patch, MRM-153-test.patch, MRM-153.patch, 
> MRM-155.patch, patch.patch
>
>
> When a maven1 client asks for /servletapi/jars/servletapi-2.4.jar, Archiva 
> converts path to the maven2 location of this artifact. As maven1 has no 
> relocation support, the jar is required in the repo. 
> Archiva can be more that a proxy : download the artifact POM, read relocation 
> infos, and return the relocated jar.
> attached Patch add a new "applyRelocation" to DefaultProxyManager.
> I've tried this code with the servletapi example, but it may be bad designed 
> as I just discovered maven / archiva APIs.

-- 
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