Ich versuche, eine Springboot-Anwendung mit Microsoft SQL Server-Verbindung zu erstellen. Ich baue Verbindung zu mysql und es funktionierte gut, aber jetzt kann ich keine Verbindung zu meiner mssql Datenbank herstellen, weil Springboot Gradle Skript 'com.microsoft.sqlserver: sqljdbc4' jar nicht lädt. Ich habe versucht, das Glas über Gradle-Skript in einem Nicht-Springboot-Projekt zu laden, und es hat gut funktioniert. Ist Springboot etwas, das ich nicht weiß? Oder gibt es ein anderes Problem?Spring Boot Gradle kann Sqlserver Abhängigkeit nicht laden
Mein gradle-Skript:
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')
}
Vielleicht ist das Problem, dass springboot versucht, die Version von sich selbst oder widersprüchlichen, weil es zu laden. Ich habe versucht, ihm auch die Version zu geben ('com.microsoft.sqlserver: sqljdbc4: 4.0'), aber es hat auch nicht funktioniert. Warum lädt mein grdle-Skript oder mein Springboot-Projekt das mssql jar nicht?
Mögliche Duplikat [Fehlende Artefakt com.microsoft.sqlserver: sqljdbc4: jar: 4.0] (http://stackoverflow.com/questions/19537396/missing-artifact-com-microsoft-sqlserversqljdbc4jar4-0) tut –