This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishing { | |
repositories { | |
maven { | |
credentials { | |
username NEXUS_USERNAME | |
password NEXUS_PASSWORD | |
} | |
url "http://[my.nexus.repo]/repository/releases/" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./gradlew -PNEXUS_USERNAME=[your_username] -PNEXUS_PASSWORD=[your_password] publish-plugin |
** Edit **
Per Amad's comments, the grailsPublish closure may be required. I modified the attributes in the closure supplied by the create-plugin script as follows:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dependencies | |
grailsPublish { | |
user = 'dspies' | |
key = 'key' | |
githubSlug = 'foo/bar' | |
license { | |
name = 'Apache-2.0' | |
} | |
title = 'My Plugin Name' | |
desc = 'My Plugin Description' | |
developers = [dspies:'David Spies'] | |
portalUser = '' | |
portalPassword = '' | |
} | |
// rest of build.gradle |
can you share your full build.gradle, because in my build.gradle, i have
ReplyDeleteapply plugin: "org.grails.grails-plugin-publish"
and when i try to publish-plugin i get error saying i am missing grailsPublish closure.
From the error message, it sounds like you deleted the default grailsPublish closure block. If that is the case, please try the grailsPublish block above and see if that resolves your issue. From looking at the source code, it appears that block is required even if you are not using it (https://github.com/grails/grails-core/blob/master/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsCentralPublishGradlePlugin.groovy).
DeleteHi David,
ReplyDeleteI did add the closure and the error goes away - however when i try to publish the generated POM has no dependencies included.
Are all the dependencies you want included in the plugin specified with 'compile' or 'runtime'? Unfortunately, I don't have access to my build.gradle at the moment to post it.
Delete