Skip to content

Instantly share code, notes, and snippets.

@johnrengelman
Created October 9, 2013 21:54
Show Gist options
  • Save johnrengelman/6909137 to your computer and use it in GitHub Desktop.
Save johnrengelman/6909137 to your computer and use it in GitHub Desktop.
Deploying custom artifact with POM dependencies using Gradle 'maven-publish'
File pluginZip = project.file("grails-${project.name}-${version}.zip")
assemble.outputs.file pluginZip
project.components.add(new JavaLibrary(
new org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact(
project.name,
'zip',
'zip',
'',
new Date(pluginZip.lastModified()),
pluginZip,
assemble
),
project.configurations.runtime.allDependencies) {
@Override
public String getName() {
return "grailsPlugin";
}
})
publishing {
publications {
artifact(MavenPublication) {
from components.grailsPlugin
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment