gradle-aws-plugin
gradle-aws-plugin copied to clipboard
Exception: Extension of type 'AmazonS3PluginExtension' does not exist
I'm getting this error while trying to use a SyncTask. Feels like I must be doing something silly. My build file is given below, as is the stack trace. Many thanks in advance.
Unadorned build.gradle
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
// classpath 'com.datastax:gradle-dsa-plugin:0.1-SNAPSHOT'
classpath "jp.classmethod.aws:gradle-aws-plugin:0.29"
}
}
plugins {
id 'com.datastax.gradle.curriculum.plugin' version '0.2'
}
apply plugin: 'com.datastax.gradle.curriculum.plugin'
apply plugin: 'jp.classmethod.aws'
//apply plugin: 'com.datastax.gradle.dsa.plugin'
courseResources {
definition = file('DS420.course')
}
task bucketSync(type: jp.classmethod.aws.gradle.s3.SyncTask) {
source project.buildDir
bucketName = 'dsa-curriculum/DS420'
}
aws {
profileName = file('~/.aws/credentials')
region = 'us-west-2'
}
Interesting Part of Stacktrace
Caused by: org.gradle.api.UnknownDomainObjectException: Extension of type 'AmazonS3PluginExtension' does not exist. Currently registered extension types: [DefaultExtraPropertiesExtension, DefaultArtifactPublicationSet_Decorated, AsciidoctorExtension_Decorated, ReportingExtension_Decorated, FactoryNamedDomainObjectContainer_Decorated, AwsPluginExtension_Decorated]
at org.gradle.api.internal.plugins.ExtensionsStorage.getHolderByType(ExtensionsStorage.java:99)
at org.gradle.api.internal.plugins.ExtensionsStorage.getByType(ExtensionsStorage.java:77)
at org.gradle.api.internal.plugins.DefaultConvention.getByType(DefaultConvention.java:113)
at jp.classmethod.aws.gradle.s3.SyncTask.uploadAction(SyncTask.java:96)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 68 more
And for the curious (verifying my credentials file):
~/Curriculum/curriculum/courses/DS420 (DS420 ✘)✹ ᐅ cat ~/.aws/credentials
[default]
aws_access_key_id = <REDACTED SO HARD>
aws_secret_access_key = <REDACTED SO HARD>
Just use apply plugin: "jp.classmethod.aws.s3" s3 at the end
adding apply plugin: "jp.classmethod.aws.s3" doesn't solve the problem
set profileName = 'default' instead of profileName = file('~/.aws/credentials')
@tlberglund Did you find a solution? I'm getting the same thing with 0.31, and I've tried both of the proposed solutions above without success.
EDIT: No, I'm wrong. yerzhanm's solution does fix this problem for me (although I would put it with the other plugin declarations). I just ended up with a different exception (related to credentials, it appears), and didn't notice. My apologies, and thanks, @yerzhanm!