私は、SQLサーバー接続がMicrosoftのSpringbootアプリケーションを構築しようとしています。私はmysqlへの接続を構築し、正常に動作しましたが、springbootのgradleスクリプトが'com.microsoft.sqlserver:sqljdbc4' jarをロードしないため、今は自分のmssqlデータベースに接続できません。私はspringboot以外のプロジェクトでは、gradleスクリプトを使ってjarファイルを読み込もうとしましたが、うまくいきました。 springbootは私が知らない何かをしていますか?それとも別の問題がありますか?スプリングブートグラデルがsqlserverの依存関係を読み込めません
私のGradleスクリプト:
buildscript {
ext {
springBootVersion = '1.4.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
jar {
baseName = 'BEAT-Surflet'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('com.microsoft.sqlserver:sqljdbc4')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework:spring-jms')
compile('org.apache.activemq:activemq-broker')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
はたぶん問題はspringbootはそれのために自分自身または競合することにより、バージョンをロードしようとしていること、です。私はexlicitもバージョンを与えようとしましたが('com.microsoft.sqlserver:sqljdbc4:4.0')、それもうまくいきませんでした。だから私のgradle-scriptやspringbootプロジェクトがmssql jarをロードしないのはなぜですか?
[Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0]の重複の可能性あり(http://stackoverflow.com/questions/19537396/missing-artifact-com-microsoft-sqlserversqljdbc4jar4-0) –