question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Gradle] 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.

See original GitHub issue

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)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

4reactions
gagan1994commented, Jun 11, 2020

Anyone found answer?

0reactions
sourcedelicacommented, Oct 20, 2022

I’m using Gradle 6.9. Plugin version 4.29.0. Single project.

plugins {
    id 'war'
    id 'maven-publish'
    id 'com.jfrog.artifactory' version '4.29.0'
}

// Let me know if you want more sections of my build.gradle

publishing {
    publications {
        maven(MavenPublication) {
            from components.web
            artifact createTar
        }
    }
}

artifactory {
    contextUrl = 'http://artifactory.mycorp.com/artifactory'
    publish {
        repository {
            repoKey = version.endsWith('SNAPSHOT') ? "twd-maven-snapshot-local-dev" : "twd-maven-local-dev"
            username = System.getenv('PUBLISH_USERNAME')
            password = System.getenv('PUBLISH_PASSWORD')
        }
        defaults {
            publications('ALL_PUBLICATIONS')
            publishConfigs('archives', 'published')
            properties = [
                    'build.branch': System.getenv('CI_COMMIT_BRANCH'),
                    'build.key': "${artifactId}-${System.getenv('CI_PIPELINE_ID')}"
            ]
        }
        publishBuildInfo = false   // FIXME - remove after RITM0074898 is fixed
        publishArtifacts = true
        publishPom = true
        publishIvy = false
    }
}

It does appear to be publishing the pom (see below). Maybe the error is spurious?

$ dotenv run gradle artifactoryPublish
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.
[pool-2-thread-1] Deploying artifact: http://artifactory.mycorp.com/artifactory/twd-maven-snapshot-local-dev/com/tw/twd/realtime/twdpubsub/1.5-SNAPSHOT/twdpubsub-1.5-SNAPSHOT.module
[pool-2-thread-1] Deploying artifact: http://artifactory.mycorp.com/artifactory/twd-maven-snapshot-local-dev/com/tw/twd/realtime/twdpubsub/1.5-SNAPSHOT/twdpubsub-1.5-SNAPSHOT.tar
[pool-2-thread-1] Deploying artifact: http://artifactory.mycorp.com/artifactory/twd-maven-snapshot-local-dev/com/tw/twd/realtime/twdpubsub/1.5-SNAPSHOT/twdpubsub-1.5-SNAPSHOT.war
[pool-2-thread-1] Deploying artifact: http://artifactory.mycorp.com/artifactory/twd-maven-snapshot-local-dev/com/tw/twd/realtime/twdpubsub/1.5-SNAPSHOT/twdpubsub-1.5-SNAPSHOT.pom

BUILD SUCCESSFUL in 4s
9 actionable tasks: 5 executed, 4 up-to-date
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot publish pom for project ':' it does not contain the ...
Cannot publish pom for project ':' it does not contain the Maven plugin install task and task ':artifactoryPublish' doesn't specify a custom pom...
Read more >
Failure: Could not determine which tasks to execute - Old Forum
I am getting the following error: $ gradle ProjectRoot:artifactoryPublish Cannot publish pom for project ':' since it does not contain the Maven plugin...
Read more >
Jenkins Artifactory Plugin Cannot Generate POM with Maven ...
Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a...
Read more >
Not able to publish the pom file with maven-publish plugin in ...
Cannot publish pom for project ':' since it does not contain the ... task and task ':artifactoryPublish' does not specify a custom pom...
Read more >
[Artifactory-users] Publish a zip and pom from a non-java ...
Cause (ref log): "Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found