[ 
http://jira.codehaus.org/browse/MNG-5017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256768#action_256768
 ] 

Sean Patrick Floyd edited comment on MNG-5017 at 2/18/11 7:41 AM:
------------------------------------------------------------------

My specific goal is to implement a solution for 
[MNG-3092|http://jira.codehaus.org/browse/MNG-3092], but even without this 
specific scenario, I'd call it a bad practice (tight coupling) to instantiate a 
specific type of a key interface when IOC is available.

My solution involves writing a replacement for {{GenericVersionScheme}} 
(actually, a wrapper around it) that creates {{VersionConstraint}} objects 
decorated with additional behavior to exclude snapshot versions from version 
ranges unless they are explicitly specified.

      was (Author: seanizer):
    My specific goal is to implement a solution for 
[MNG-3092|http://jira.codehaus.org/browse/MNG-3092], but even without this 
specific scenario, I'd call it a bad practice (tight coupling) to instantiate a 
specific type of a key interface when IOC is available.

My solution involves writing a replacement for {{{GenericVersionScheme}}} 
(actually, a wrapper around it) that creates {{{VersionConstraint}}} objects 
decorated with additional behavior to exclude snapshot versions from version 
ranges unless they are explicitly specified.
  
> Register VersionScheme as Plexus Component
> ------------------------------------------
>
>                 Key: MNG-5017
>                 URL: http://jira.codehaus.org/browse/MNG-5017
>             Project: Maven 2 & 3
>          Issue Type: Wish
>          Components: Artifacts and Repositories
>    Affects Versions: 3.0.2
>            Reporter: Sean Patrick Floyd
>            Priority: Minor
>
> 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

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