publishMavenJavaPublicationToMavenLocal doesn't honor GAV settings which publish does


(Peter Kahn) #1

How can I get publish to local and publish to remote to behave identically?

When I execute “install” gradle 2.0 only copies project jar to local maven repository using projects G-A-V and ignores foo.jar.

When I execute “publish” gradle uploads foo jar to my nexus using specified GAV ( Uploading: foo/bar/art/2/art-2.jar to repository remote at …). I spent a fair amount of time thinking I couldn’t set G,A,V coordinates at all until I attempted publish/deploy to remote and discovered it works just not as expected.

any clue as to why publish local and publish remote behave differently?

apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'
  publishing {
    publications {
        myPublication(MavenPublication) {
            groupId 'foo.bar'
            artifactId 'art'
            version '2'
            artifact file('my.jar')
        }
    }

Thanks

Peter


(Peter Niederwieser) #2

Probably because you are publishing to local with the old ‘maven’ plugin, and to remote with the new ‘maven-publish’ plugin. (The latter is meant to supersede the former.) Try ‘gradle publishToMavenLocal’.