You can write a task that accesses the publications and their GAV via the publication container. For example:
apply plugin: 'java'
apply plugin: 'maven-publish'
group = 'org.some'
version = '1.0.0'
publishing {
publications {
somePub( MavenPublication ) {
from components.java
}
someOtherPub( MavenPublication ) {
groupId = 'org.other'
artifactId = 'cool-thing'
version = '1.2.3'
}
}
}
task dumpPublications {
doLast {
publishing.publications.withType( MavenPublication ) { pub ->
logger.lifecycle "${pub.name} => ${pub.groupId}:${pub.artifactId}:${pub.version}"
}
}
}
Output:
$ gradle dumpPublications
> Task :dumpPublications
someOtherPub => org.other:cool-thing:1.2.3
somePub => org.some:gav-test:1.0.0