Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aether-users] How to calculate the transitive dependencies of not installed (yet) project ?

Hello,

I've created a aggregator mojo that must pack some declared dependencies in the current pom (including transitive ones). All dependencies were previously installed in local repo, but the current rootProject is not yet.
I'm using the following that I took from aether demo:

rootArtifact = toArtifact(getProject().getArtifact());
CollectRequest collectRequest = new CollectRequest();
            collectRequest.setRoot(new Dependency(rootArtifact,
                    JavaScopes.COMPILE));
            collectRequest.setRepositories(remoteRepos);

            DependencyRequest dependencyRequest = new DependencyRequest(
                    collectRequest, new DependencyFilter() {

                        @Override
                        public boolean accept(DependencyNode node,
                                List<DependencyNode> parents) {
                            return node.getDependency().getScope()
                                    .equals(JavaScopes.COMPILE)
                                    && !node.getDependency().isOptional();
                        }
                    });

            List<ArtifactResult> artifactResults = repositorySystem
                    .resolveDependencies(repositorySystemSession,
dependencyRequest).getArtifactResults();


But I'm getting an empty result .

could someone point me to what I'm missing here ?


thanks for any tip,

Cristiano


Back to the top