Uploaded image for project: 'Archiva'
  1. Archiva
  2. MRM-596

regression : cannot get java-sources anymore from maven1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-4
    • 1.0
    • WebDAV Interface
    • None

    Description

      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 :

      // Sanity Check: does extension match pathType on path?
      String trimPathType = expectedType.substring( 0, expectedType.length() - 1 );

      String expectedExtension = ArtifactExtensionMapping.getExtension( trimPathType );

      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 );
      }

      Attachments

        1. MRM-596.patch
          31 kB
          nicolas de loof

        Activity

          People

            Unassigned Unassigned
            ndeloof nicolas de loof
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: