android studio build.gradleでスプリングブートを使用する正しい方法は何ですか? これは私がusing-午前何アンドロイドスタジオのスプリングブート
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.3.RELEASE")
}
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.prateek.businesscardrest"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/spring.schemas'
exclude 'META-INF/spring.tooling'
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/spring.handlers'
}
configurations {
all*.exclude module: 'classworlds'
all*.exclude module: 'commons-logging'
all*.exclude module: 'httpclient'
all*.exclude module: 'maven-artifact'
all*.exclude module: 'maven-artifact-manager'
all*.exclude module: 'maven-error-diagnostics'
all*.exclude module: 'maven-model'
all*.exclude module: 'maven-project'
all*.exclude module: 'maven-settings'
all*.exclude module: 'plexus-container-default'
all*.exclude module: 'plexus-interpolation'
all*.exclude module: 'plexus-utils'
all*.exclude module: 'wagon-file'
all*.exclude module: 'wagon-http-lightweight'
all*.exclude module: 'wagon-provider-api'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'org.springframework:spring-web:3.1.1.RELEASE'
compile 'com.google.code.findbugs:jsr305:2.0.1'
testCompile 'junit:junit:4.12'
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
}
である。しかし、これはエラー - エラーを生成します。解決に失敗しました:org.springframework.boot:春・ブート・スターター・ウェブ