Archiva

Cannot proxy maven2 plugin (jaxb) from a maven1 repository (http://download.java.net/maven/1)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Linux
  • Number of attachments :
    0

Description

Legacy Artifact Path Resolution returns error message when configuring a Maven plugin in a Maven 1 repo if direcotry is not under "plugins."

Example:

Artifact location: http://download.java.net/maven/1/com.sun.tools.xjc.maven2/maven-plugins/maven-jaxb-plugin-1.1.jar

Configuration:

Path: com.sun.tools.xjc.maven2/maven-plugins/maven-jaxb-plugin-1.1.jar
GroupId: com.sun.tools.xjc.maven2
ArtifactId: maven-jaxb-plugin
Version: 1.1
Classifier:
Type: maven-plugin

Error message:

artifact reference does not match the initial path : com.sun.tools.xjc.maven2/plugins/maven-jaxb-plugin-1.1.jar

Also, the auto complete feature does not correctly slice the input initially:

ArtifactId: maven
Version: jaxb-plugin-1.1

Activity

Hide
nicolas de loof added a comment -

The issue is not about legacy artifact path support but about legacy-layout support from proxyConnectors.

The requested ArtifactReference is of type "maven-plugin" as we could expect for a m2 plugin request. This is converted in M1 layout to "/plugins/" according to AbstractLegacyRepositoryContent.typeToDirectoryMap

But a m2 maven-plugin project deployed on a legacy-layout repository will use "/maven-plugins/" as configured by maven ArtifactHandler (maven-artifact).

I think we must split the "plugin" type into maven-plugin for M2 plugins and "maven-one-plugin" for M1 plugins (as specified by ArtifactHandler in maven-one-plugin) to avoid such conflicts.

Show
nicolas de loof added a comment - The issue is not about legacy artifact path support but about legacy-layout support from proxyConnectors. The requested ArtifactReference is of type "maven-plugin" as we could expect for a m2 plugin request. This is converted in M1 layout to "/plugins/" according to AbstractLegacyRepositoryContent.typeToDirectoryMap But a m2 maven-plugin project deployed on a legacy-layout repository will use "/maven-plugins/" as configured by maven ArtifactHandler (maven-artifact). I think we must split the "plugin" type into maven-plugin for M2 plugins and "maven-one-plugin" for M1 plugins (as specified by ArtifactHandler in maven-one-plugin) to avoid such conflicts.
Hide
Brett Porter added a comment -

agreed. Notice this will suffer the same problems as ejbs in that you won't be able to proxy this plugin via an m2 request, you'll have to use the legacy layout the whole way through.

Show
Brett Porter added a comment - agreed. Notice this will suffer the same problems as ejbs in that you won't be able to proxy this plugin via an m2 request, you'll have to use the legacy layout the whole way through.
Hide
nicolas de loof added a comment -

Fixed :
use a distinct "type" for MAVEN_PLUGIN and MAVEN_ONE_PLUGIN
testCase included

Show
nicolas de loof added a comment - Fixed : use a distinct "type" for MAVEN_PLUGIN and MAVEN_ONE_PLUGIN testCase included

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: