[ 
https://issues.apache.org/jira/browse/MNG-7283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17425176#comment-17425176
 ] 

Michael Osipov commented on MNG-7283:
-------------------------------------

Your approach is wrong aka you did not read/try hard enough. What you want to 
have an interface where you load your implementations on the fly which reside 
on the classpath. You are best to implement the {{ServiceLoader}} and load all 
providers dynamically. You can identify your providers by URIs, e.g, 
{{mq+aws://...}}, boils down to {{<protocol>+<transport>://...}}, same is done 
in Maven SCM. You can either bundle all provider implementations or create POM 
module which will create assemblies with whatever you need.

Upshot: There is no need to add dependencies at build time dynamically.

> add dependency when maven exec
> ------------------------------
>
>                 Key: MNG-7283
>                 URL: https://issues.apache.org/jira/browse/MNG-7283
>             Project: Maven
>          Issue Type: Wish
>          Components: Dependencies
>            Reporter: wangjie
>            Priority: Major
>             Fix For: wontfix-candidate
>
>
> *1、background*
> as we all kown, each cloud environment has different component 
> implementations. For example: The message queue components of AWS and Alibaba 
> Cloud are similar in function, but different in implementation.
> we are try to build a unified API specification, developers only need to 
> introduce unified standardized APIs for these components when developing. 
> When the project is built and deployed on different clouds, we will 
> automatically introduce the implementation dependencies of different 
> components under different clouds for the project.
> *2、issues*
> Due to the above reason, we hope to add some dependencies when maven starts 
> to build the project. After reading the documentation and google related 
> issues, I found that maven does not support this feature(I don’t know much 
> about maven. If maven supports this feature, please share with me. Thanks in 
> advance).
> If maven does not support adding dependencies at the beginning of the build, 
> can the community consider supporting this feature?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to