I need to use Amazon Maps and Amazon Messaging in my apps.
With gradle, I did not succeed in adding the Amazon dependencies with a \"provided\" scope as they need to
The solution that I've been using is pretty simple. You must add the following code to your build.gradle file:
apply plugin: 'eclipse' // Eclipse users only
configurations {
provided
}
sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
eclipse.classpath.plusConfigurations += configurations.provided // Eclipse users only
If you are not an Eclipse user (I'm not), you don't actually need the first and last lines, as you might have guessed.
Once the above configuration additions are in, you can then simply add a provided dependency in your dependencies section alongside of any regular compile dependencies:
dependencies {
compile group: 'org.springframework', name: 'spring-core', version: '3.2.6.RELEASE'
provided group: 'javax.servlet', name: 'servlet-api', version:'2.5'
provided group: 'javax.servlet.jsp', name: 'jsp-api', version:'2.1'
}
Hope that helps. It's been working quite well for me for some time.