Closed as not planned
Description
Running any Gradle task triggers lots of Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
messages.
Example build.gradle
to reproduce:
plugins {
id 'java-gradle-plugin'
id 'groovy'
id 'maven-publish'
id 'com.jfrog.artifactory' version '4.13.0'
}
group = "com.example.artifactory.gradle.test"
version = "1.2.3.9"
dependencies {
implementation gradleApi()
implementation localGroovy()
implementation "com.google.guava:guava:28.2-jre"
}
gradlePlugin {
plugins {
simplePlugin {
id = 'com.example.artifactory.gradle.test'
implementationClass = 'com.example.artifactory.gradle.test.TestPlugin'
}
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
repository {
repoKey = 'publish-test'
username = artifactory_user
password = artifactory_password
maven = true
}
defaults {
// this is needed because some of our project produce no artifacts but have dependencies (in lots of different custom configurations)
configurations.each { conf ->
if (conf.canBeResolved) publishConfigs(conf.name)
}
// this is needed because otherwise the artifactory plugin does _NOTHING_ publishToMavenLocal works just fine...
project.publishing.publications.each { pub ->
publications(pub.name)
}
publishPom = true
}
}
resolve {
repository {
repoKey = 'dependencies'
username = artifactory_user
password = artifactory_password
maven = true
}
}
}
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path.
16:57:30 > Task :compileJava NO-SOURCE
16:57:42 > Task :compileGroovy
16:57:42 > Task :pluginDescriptors
16:57:42 > Task :processResources
16:57:42 > Task :classes
16:57:42 > Task :jar
16:57:42 > Task :assemble
16:57:42 > Task :pluginUnderTestMetadata
16:57:42 > Task :artifactoryPublish
16:57:42 Deploying artifact: https://artifactory/artifactory/publish-test/com/example/artifactory/gradle/test/gradle-plugin-test/1.2.3.9/gradle-plugin-test-1.2.3.9.jar
16:57:43 > Task :artifactoryDeploy
16:57:43
16:57:43 BUILD SUCCESSFUL in 23s
16:57:43 7 actionable tasks: 7 executed
Expected behavior:
- I expect that such a simple project (in terms of build.gradle setup of artifacts and dependencies) automatically publishes all artifacts, that
publishToMavenLocal
would publish, to artifactory. - I expect that all dependencies of the build are listed in the build info of such a build (running with Jenkins) also of subprojects that have no artifacts! -> see also inline comments above
- and while we are at this: why are the build dependencies not published in the build infos? having bad jars on the build classpath is also something I would want to get notified by Xray.
So far it seems to be impossible to publish all artifacts and have all dependencies in the build-info without also having MEGABYTES of the warning above in the build logs (our actual builds have many more subprojects obviously)