Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5017

Register VersionScheme as Plexus Component

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 3.0.2
    • Fix Version/s: None
    • Labels:
      None

      Description

      I would like to implement custom VersionConstraints, and have thought of creating a subclass of GenericVersionScheme to achieve that. However, I had to realize that GenericVersionScheme is instantiated via new GenericVersionScheme() instead of dependency injection.

      Please register GenericVersionScheme as a Plexus Component with the role org.sonatype.aether.version.VersionScheme, and use the injected version, that way I can write extensions that provide a wrapped version.

      Here are the affected instantiations that I could find:

      GenericVersionScheme() - org.sonatype.aether.util.version.GenericVersionScheme
      isMavenVersion(String) : boolean - org.apache.maven.rtinfo.internal.DefaultRuntimeInformation
      MytoysGenericVersionScheme - de.mytoys.maven.version.resolver
      resolveVersionRange(RepositorySystemSession, VersionRangeRequest) : VersionRangeResult - org.apache.maven.repository.internal.DefaultVersionRangeResolver
      selectVersion(DefaultPluginVersionResult, PluginVersionRequest, Versions) : void - org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver

        Attachments

        1. VersionSchemePatch.txt
          5 kB
          Sean Patrick Floyd

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              seanizer Sean Patrick Floyd
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: