In che modo Maven gestisce internamente la dipendenza del pacchetto?

1

Qualcuno può farmi sapere in che modo Maven gestisce internamente la dipendenza del pacchetto? C'è qualche schema di architettura disponibile sulla rete per lo stesso? Ho anche chiesto questo in Quora e user user maven elenco ma non ha ricevuto alcuna risposta loro né io sono in grado di trovare nel web tutte le risorse adatte che spiegano il funzionamento di Maven e ancora meglio se riesco a trovare qualche diagramma di classe?

    
posta tuk 15.06.2016 - 18:07
fonte

1 risposta

1

Maven usa internamente l'iniezione delle dipendenze. Tra la versione 2 e 3 ha cambiato l'implementazione da Plexus a Guice :

Maven has a long history of using dependency injection (DI) by way of Plexus, so the intent of using JSR-330 is to replace a custom DI mechanism with something standard. The implementation Maven uses - since 3.0-beta-3 - is based on Guice 3.x, which directly supports JSR-330.

If you are using Plexus annotations and APIs currently, there is no rush to switch and no big bang conversions are necessary: Plexus, JSR-330 and Guice APIs all happily co-exist within Maven's core and you can choose to use JSR-330 when you wish. There are hundreds of components written using the Plexus APIs, particularly components and plugins compatible with Maven 2, then those APIs will be supported forever, or at least until Maven fully drops Maven 2 support.

Maven's goal was never to create a dependency injection framework, it was always focused on builds and the infrastructure that supports development. Not long ago, we were contemplating what it would take to improve Plexus, we looked at the effort required to document and support Plexus going forward, and it just didn't make any sense for us to continue to apply precious time and effort to a problem that had already been solved by several others. It makes sense to focus the community, and moving to Guice will allow us to devote more of our own resources to supporting the central projects and products.

Riferimenti

risposta data 22.08.2018 - 17:12
fonte