0

I would like to install a 'pom' artifact in my local repository, that contains all the dependencies declared with gradle. Here is what I got:

apply plugin: 'base'
apply plugin: 'maven-publish'

dependencies {
 (...)
}

group = 'org.test'
version = '1.0-SNAPSHOT'

publishing {
    repositories {
        maven {
            url "http://maven/nexus/content/groups/public"
        }
    }
}

publishToMavenLocal {
  outputs.upToDateWhen { false }
}

The INFO output shows:

:publishToMavenLocal
Skipping task ':publishToMavenLocal' as it has no actions.
:publishToMavenLocal UP-TO-DATE
:publishToMavenLocal (Thread[Daemon worker,5,main]) completed. Took 0.002 secs.

How can I get rid of that checking?

UPDATE:

Added a publication:

publishing {
    publications {
        mavenJava(MavenPublication) {
        }
    }
}

Now the artifact does install but the pom.xml doesn't have any dependency in it.

UPDATE2:

According to this, "Gradle makes it pretty easy to upload JAR files with signing etc. but there is no way to publish just a POM.", is that still the case?

benji
  • 2,331
  • 6
  • 33
  • 62
  • Did you look up documentation for the maven-publish plugin? You need to declare a `publication` besides the repository in the `publishing` section. see here: https://docs.gradle.org/current/userguide/publishing_maven.html – RaGe Jun 17 '16 at 18:03
  • Ah, thanks, I updated the post. – benji Jun 17 '16 at 18:12
  • Possible duplicate of [Can I create a Maven POM-only (BOM) build using the Gradle maven plugin to be deployed to Nexus?](https://stackoverflow.com/questions/43374613/can-i-create-a-maven-pom-only-bom-build-using-the-gradle-maven-plugin-to-be-de) – acdcjunior May 25 '19 at 06:14

0 Answers0