public Set<Artifact> resolveTransitively( Set<Artifact> jarResourceArtifacts, Set<MavenProject> siblingProjects,
                                              Artifact originateArtifact, ArtifactRepository localRepository,
                                              List<ArtifactRepository> remoteRepositories,
                                              ArtifactFilter artifactFilter, Map managedVersions )
            throws MojoExecutionException
    {

        Set<Artifact> resultArtifacts = new LinkedHashSet<>();

        if ( CollectionUtils.isNotEmpty( siblingProjects ) )
        {

            // getting transitive dependencies from project
            for ( MavenProject siblingProject : siblingProjects )
            {
                Set<Artifact> artifacts = siblingProject.getArtifacts();
                for ( Artifact artifact : artifacts )
                {
                    if ( artifactFilter.include( artifact ) )
                    {

                        resultArtifacts.add( artifact );
                    }
                }
            }
        }
        try
        {
            ArtifactResolutionResult result =
                    artifactResolver.resolveTransitively( jarResourceArtifacts, originateArtifact,
                                                          managedVersions,
                                                          localRepository, remoteRepositories, this.artifactMetadataSource,
                                                          artifactFilter );

            resultArtifacts.addAll( result.getArtifacts() );

            return resultArtifacts;
        }
        catch ( ArtifactResolutionException e )
        {
            throw new MojoExecutionException( "Could not resolv transitive dependencies", e );
        }
        catch ( ArtifactNotFoundException e )
        {
            throw new MojoExecutionException( "Could not find transitive dependencies ", e );
        }
    }
public Set < Artifact > resolveTransitively ( Set < Artifact > jarResourceArtifacts , Set < MavenProject > siblingProjects , Artifact originateArtifact , ArtifactRepository localRepository , List < ArtifactRepository > remoteRepositories , ArtifactFilter artifactFilter , Map managedVersions ) throws MojoExecutionException { Set < Artifact > resultArtifacts = new LinkedHashSet < > ( ) ; if ( CollectionUtils . isNotEmpty ( siblingProjects ) ) { for ( MavenProject siblingProject : siblingProjects ) { Set < Artifact > artifacts = siblingProject . getArtifacts ( ) ; for ( Artifact artifact : artifacts ) { if ( artifactFilter . include ( artifact ) ) { resultArtifacts . add ( artifact ) ; } } } } try { ArtifactResolutionResult result = artifactResolver . resolveTransitively ( jarResourceArtifacts , originateArtifact , managedVersions , localRepository , remoteRepositories , this . artifactMetadataSource , artifactFilter ) ; resultArtifacts . addAll ( result . getArtifacts ( ) ) ; return resultArtifacts ; } catch ( ArtifactResolutionException e ) { throw new MojoExecutionException ( "Could not resolv transitive dependencies" , e ) ; } catch ( ArtifactNotFoundException e ) { throw new MojoExecutionException ( "Could not find transitive dependencies " , e ) ; } }
{@inheritDoc}