Some of my projects have dependencies on other projects which are build with classifiers. eg.
myproject.jar
myproject-myclassifier.jar
In a plugin I need to iterate the dependencies and perform a certain operation if the dependency has a specific classifier. I thought I could do:
for (Configuration configuration : configurations) {
DependencySet allDependencies = configuration.getAllDependencies();
for (Dependency dependency : allDependencies) {
System.out.println(dependency.CLASSIFIER)
System.out.println(dependency.getName());
}
but that does not get the classifier info. I have also tried:
PublishArtifactSet artifacts = configuration.getArtifacts();
for (PublishArtifact publishArtifact : artifacts) {
System.out.println("this is publishArtifact.getClassifier() : " + publishArtifact.getClassifier());
System.out.println("this is publishArtifact.getName() : " + publishArtifact.getName());
This seems to be the right info. The only problem is that its “this” project’s classifier and not “this” project’s dependencies classifiers. Is there any way to get the classifier info for a projects dependencies?