Forked from outofcoffee/gradle-kotlin-publish-s3-maven-repo.gradle
Created
March 4, 2019 11:40
-
-
Save alexgtn/7138d21e9b9f2f7728aed811ca485c0c to your computer and use it in GitHub Desktop.
Publish a Kotlin module to an S3 Maven repository, using Gradle.
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
/* | |
* Publish a Kotlin module to an S3 Maven repository, using Gradle. | |
* This assumes that the AWS/IAM credentials have 'bucket list' as well as 'object put' and 'object get' permissions. | |
*/ | |
ext.version_kotlin = '1.0.5-2' | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$version_kotlin" | |
} | |
} | |
repositories { | |
mavenCentral() | |
} | |
apply plugin: 'kotlin' | |
apply plugin: 'maven-publish' | |
dependencies { | |
compile "org.jetbrains.kotlin:kotlin-stdlib:$version_kotlin" | |
// other dependencies... | |
} | |
publishing { | |
publications { | |
maven(MavenPublication) { | |
groupId 'com.example' | |
artifactId 'example' | |
version '0.0.1-SNAPSHOT' | |
from components.java | |
repositories { | |
maven { | |
url 's3://your-s3-bucket/snapshots' | |
credentials(AwsCredentials) { | |
accessKey AWS_ACCESS_KEY // put this in gradle.properties | |
secretKey AWS_SECRET_KEY // put this in gradle.properties | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment