Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Collecting list of transitive dependencies *and* necessary parent POMs

We have code that creates dependency tree with parent nodes we can
probably open source. 

In the mean time, here is the basic idea

* Maven 3.2.4+ has new ArtifactDescriptorReaderDelegate, which I
extended to create Aether parent project dependencies artifacts. These
artifacts have marker property to distinguish them from other artifacts.

* The custom ArtifactDescriptorReaderDelegate implementation is enabled
using DefaultRepositorySystemSession#setConfigProperty (see how this is
used in DefaultArtifactDescriptorReader around line 222)

* DependencyGraphTransformer is used to rearrange project/parent nodes
in the resolved graph. You probably don't need this If you just need
flat list of artifacts to download.

-- 
Regards,
Igor

On Fri, May 8, 2015, at 06:10 AM, Andreas Sewe wrote:
> Hi again,
> 
> for the benefits of others, here's my findings so far (problem still
> unsolved):
> 
> > Likewise, RepositorySystem.collectDependencies(..) doesn't seem to do
> > what I want out of the box, but maybe there is a way to accomplish what
> > I want using a custom DependencyCollector, but given the size of
> > DefaultDependencyCollector's implementation I wanted to ask first
> > whether something like this already exists.
> 
> I used the GetDependencyHierarchy as starting point of my odyssee
> through Aether. So far I have found out the following:
> 
> - The solution to my problem *cannot* reside on the Aether side, as
> Aether has no concept of "parent". The ArtifactDescriptor returned by
> RepositorySystem.readArtifactDescriptor(..) just has dependencies but no
> parent which Aether could make use during a subsequent
> RepositorySystem.collectDependencies. Hence, a custom
> DependencyCollector won't help.
> 
> - Maven's DefaultArtifactReader relies on a ModelBuilder. If I could get
> a custum implementation to return a ModelBuildingResult with an
> effective model listing the parents as dependencies I might be done.
> 
> - Maybe wrapping DefaultModelBuilder.build(..) and changing the
> ModelBuildingResult's effective model on the fly so that the parent is
> also listed as a dependency does the trick. Will try this out.
> 
> Any hints on how else to proceed are greatly appreciated, however.
> 
> Andreas
> 
> -- 
> Codetrails GmbH
> The knowledge transfer company
> 
> Robert-Bosch-Str. 7, 64293 Darmstadt
> Phone: +49-6151-276-7092
> Mobile: +49-170-811-3791
> http://www.codetrails.com/
> 
> Managing Director: Dr. Marcel Bruch
> Handelsregister: Darmstadt HRB 91940
> _______________________________________________
> aether-users mailing list
> aether-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/aether-users


Back to the top