I'm trying to create a new project with Magnolia and the Gradle dependencies are not found.
Tried this
https://mvnrepository.com/artifact/info.magnolia.blossom/magnolia-module-blossom
Gradle build returns
Could not find info.magnolia.blossom:magnolia-module-blossom:3.1.3.
The gradle file content:
buildscript {
ext {
springBootVersion = '1.3.5.RELEASE'
}
repositories {
mavenCentral()
maven {
url "http://mvnrepository.com/artifact/org.hibernate/hibernate-search-orm"
url "https://mvnrepository.com/artifact/info.magnolia.blossom/magnolia-module-blossom/3.1.3"
url "https://repo.spring.io/libs-milestone"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot'
apply plugin: 'war'
war {
baseName = 'test.app'
version = '1.0.0'
}
springBoot {
mainClass = 'com.test.app.Application'
executable = true
}
bootRun {
addResources = true
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-configuration-processor')
compile('org.springframework.boot:spring-boot-actuator-docs')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-redis')
compile('org.springframework.boot:spring-boot-starter-jersey')
compile('org.springframework.boot:spring-boot-starter-mail')
compile('org.springframework.boot:spring-boot-starter-remote-shell')
compile('org.springframework.boot:spring-boot-starter-security')
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-websocket')
compile('org.springframework.session:spring-session:1.2.2.RELEASE')
compile group: 'org.hibernate', name: 'hibernate-search-orm', version: '5.1.0.Final'
compile group: 'com.ryantenney.metrics', name: 'metrics-spring', version: '3.1.3'
compile group: 'io.dropwizard.metrics', name: 'metrics-annotation', version: '3.1.2'
compile group: 'io.dropwizard.metrics', name: 'metrics-graphite', version: '3.1.2'
compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.1.2'
compile group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: '3.1.2'
compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.1'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
compile group: 'commons-validator', name: 'commons-validator', version: '1.5.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.2'
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1'
compile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.5.0'
compile group: 'org.springframework.security', name: 'spring-security-taglibs', version: '4.1.3.RELEASE'
//https://mvnrepository.com/artifact/org.springframework.security/spring-security-messaging
compile group: 'org.springframework.security', name: 'spring-security-messaging', version: '4.1.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-mail', version: '1.3.6.RELEASE'
// Magnolia
compile group: 'info.magnolia', name: 'magnolia-core', version: '5.5'
compile group: 'info.magnolia.blossom', name: 'magnolia-module-blossom', version: '3.1.3'
compile group: 'jstl', name: 'jstl', version: '1.2'
compile('org.ocpsoft.prettytime:prettytime:4.0.1.Final')
runtime('mysql:mysql-connector-java')
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
testCompile('org.springframework.boot:spring-boot-starter-test')
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
Are there other repositories I can use?
Best Regards,
Razvan
I see two issues you might have
First you added the additional repositories to the repositories block inside the buildscript block. Those are only used for the dependencies of the build script itself like the spring plugin.
What you want is to add at least the blossom repository to the second repositories block where you define the repositories for the dependencies of your application.
The other issue I see is the referenced repositories might be wrong. First only use one url per maven block and the URL might not point to correct maven repositories. Try something like the following:
buildscript {...}
repositories {
mavenCentral()
maven {
url "https://nexus.magnolia-cms.com/content/groups/public/"
}
maven {
url "https://repo.spring.io/libs-milestone"
}
}
Hope that helps.
Related
gradle test
Task :compileJava FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileJava'.
Could not resolve all dependencies for configuration ':detachedConfiguration1'.
Could not resolve org.springframework.boot:spring-boot-dependencies:2.2.7.RELEASE.
Required by:
project :
> Could not resolve org.springframework.boot:spring-boot-dependencies:2.2.7.RELEASE.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.2.7.RELEASE/spring-boot-dependencies-2.2.7.
RELEASE.pom'.
> Could not HEAD 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.2.7.RELEASE/spring-boot-dependencies-2.2.7.RELEA
SE.pom'.
> repo.maven.apache.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
buildscript {
repositories {
maven {
url "https://rb-artifactory.bosch.com/artifactory/gradle-plugins-remote/"
credentials {
username "***"
password "***"
}
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.7.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "io.spring.dependency-management"
apply plugin: 'org.springframework.boot'
apply plugin: 'war'
apply plugin: 'jacoco'
apply plugin: 'application'
jacocoTestReport{
reports{
xml.enabled true
csv.enabled true
html.enabled true
}
}
// This comes out to package + '.' + mainClassName
mainClassName = 'com.bosch.shop.ShopAuthentication'
repositories {
mavenCentral()
/* maven {
credentials {
username "EED1COB"
password "AP28P2xA2dB6pCNDcbrxx7uVuNo"
}
url "https://rb-artifactory.bosch.com/artifactory/gradle-mvn-remote/"
}*/
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
providedRuntime
}
bootRun {
// allows ./gradlew bootRun -Dspring.profiles.active=dev
systemProperties System.properties
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web"){
exclude group: 'org.apache.tomcat'
}
implementation( "mysql:mysql-connector-java:5.1.28" )
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation('org.springframework.boot:spring-boot-starter-data-mongodb')
implementation("io.springfox:springfox-swagger2:2.6.1")
//implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
implementation("io.springfox:springfox-swagger-ui:2.6.1")
//implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
implementation("com.google.code.gson:gson:2.8.2")
implementation("com.ocpsoft:ocpsoft-pretty-time:1.0.7")
implementation('org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2')
implementation ('org.json:json:20180130')
implementation("com.jayway.jsonpath:json-path:2.0.0")
implementation("com.mashape.unirest:unirest-java:1.4.9")
implementation("io.jsonwebtoken:jjwt:0.5.1")
implementation platform('org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE')
implementation 'org.springframework.boot:spring-boot-starter-web'
//implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.2'
//overridden-
//implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta2'
implementation group: 'com.google.guava', name: 'guava', version: '27.1-jre'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '9.0.37'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: '9.0.37'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-el', version: '9.0.37'
implementation("com.sun.jersey:jersey-client:1.9.1")
implementation group: 'com.zaxxer', name: 'HikariCP', version: '3.2.0'
implementation group: 'org.locationtech.spatial4j', name: 'spatial4j', version: '0.7'
testImplementation('org.springframework.boot:spring-boot-starter-test')
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
testImplementation("junit:junit:4.12")
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.23.0'
implementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.9.7'
implementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.9.7'
// https://mvnrepository.com/artifact/com.azure/azure-core
implementation group: 'com.azure', name: 'azure-core', version: '1.22.0'
// https://mvnrepository.com/artifact/com.azure/azure-messaging-servicebus
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.4.2'
implementation group: 'io.projectreactor', name: 'reactor-core', version: '3.4.12'
implementation group: 'com.azure', name: 'azure-core-amqp', version: '2.3.4'
implementation group: 'org.mongodb', name: 'mongo-java-driver', version: '3.12.10'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.apache.logging.log4j') {
details.useVersion '2.15.0'
}
}
}
I'm trying to synchronize a gradle project with some dependences to Spring Boot and Maven, but there is an error that indicates the following repositories used in the project are not indexed yet:
Unindexed remote maven repositories found.
The following repositories used in your gradle projects were not
indexed yet:
http://repo.spring.io/milestone
http://repo.spring.io/snapshot
https://repo1.maven.org/maven2
https://plugins.gradle.org/m2
If you want to use dependency completion for these repositories
artifacts, Open Repositories List, select required repositories and press "Update" button.
Then I'm trying to update the remote repositories manually, but I'm getting an error while I trying to do.
Any know what can I do to resolve the issue?
I'm using IntelliJ IDEA 2017.1.6 and the gradle version is 2.2, I leave the build.gradle file of the project with the dependencies that I use.
group 'com.scl.boot'
version '0.5'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'war'
apply plugin: 'spring-boot'
apply plugin: 'org.sonarqube'
apply plugin: 'com.bmuschko.cargo'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
buildscript {
repositories {
jcenter()
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'http://repo.spring.io/milestone' }
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.2.7.RELEASE'
classpath 'org.sonarqube.gradle:gradle-sonarqube-plugin:1.1'
classpath 'com.bmuschko:gradle-cargo-plugin:2.2.1'
}
}
repositories {
maven { url 'http://repo.spring.io/snapshot' }
maven { url 'http://repo.spring.io/milestone' }
mavenCentral()
jcenter()
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-aop'
compile 'org.springframework.boot:spring-boot-starter-logging'
compile 'org.springframework.boot:spring-boot-starter-security'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-rest', version: '1.3.6.RELEASE'
compile 'org.jsondoc:spring-boot-starter-jsondoc:1.2.9'
compile 'org.jsondoc:jsondoc-ui-webjar:1.2.9'
compile 'org.springframework:spring-jdbc'
compile 'org.springframework.data:spring-data-oracle:1.2.1.RELEASE'
compile group: 'cn.easyproject', name: 'ojdbc7', version: '12.1.0.2.0'
compile group: 'org.springframework.data', name: 'spring-data-jdbc-core', version: '1.2.1.RELEASE'
compile 'org.apache.tomcat:tomcat-dbcp:8.0.28'
compile 'org.slf4j:slf4j-api:1.7.+'
compile 'org.op4j:op4j-jodatime:1.1'
compile 'org.springframework.boot:spring-boot-devtools:1.3.0.M2'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile 'org.json:json:20151123'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.codehaus.groovy:groovy-all'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.3'
compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: '2.8.3'
cargo 'org.jboss.as:jboss-as-controller-client:7.2.0.Final'
compile group: 'org.codehaus.cargo', name: 'cargo-core-uberjar', version: '1.5.0'
cargo 'org.codehaus.cargo:cargo-ant:1.4.16'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'org.springframework.boot:spring-boot-starter-test:1.2.7.RELEASE'
testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
}
war {
archiveName = "CyCRest.war"
configurations {
runtime.exclude module: 'spring-boot-starter-tomcat'
runtime.exclude module: 'spring-boot-starter-logging'
}
}
[EDIT] This is the idea.log file with the exceptions that I'm getting:
java.io.IOException: Transfer for nexus-maven-repository-index.gz
failed
Download the log file.
My application is a Gradle Multi Module Project, consisting of multiple services with one service-common module.
I´ve pulled all dependencies that all modules have in common out into the root build.gradle, and I also want to include the service-common module in all subprojects, which in theory works, but I´m getting a circular dependency issue because it is included in itself.
apply plugin: 'java'
group = 'com.myapplication'
ext {
set('springCloudVersion', "2.2.0.RELEASE")
set('springBootVersion', "2.2.2.RELEASE")
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
}
buildscript {
ext {
springBootVersion = "2.2.2.RELEASE"
}
repositories {
maven { url 'https://repo.spring.io/plugins-snapshot' }
jcenter()
mavenCentral()
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.7.BUILD-SNAPSHOT'
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
subprojects {
version = '1.0'
apply plugin: 'org.springframework.boot'
apply plugin: "io.spring.dependency-management"
apply plugin: 'java'
ext {
springCloudVersion = "2.2.0.RELEASE"
springBootVersion = "2.2.2.RELEASE"
}
test {
useJUnitPlatform()
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://repo.spring.io/milestone' }
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: "${springBootVersion}"
compile group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: "${springBootVersion}"
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter', version: "${springCloudVersion}"
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-kubernetes', version: '1.1.1.RELEASE'
compile group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.2'
compile group: 'com.github.piomin', name: 'logstash-logging-spring-boot-starter', version: '1.2.2.RELEASE'
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
testCompile group: 'com.h2database', name: 'h2', version: '1.4.200'
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.9'
testCompile group: 'org.springframework.cloud', name: 'spring-cloud-stream-test-support', version: "${springCloudVersion}"
implementation project(":service-common")
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
How can I exclude implementation project(":service-common") for the service-common module?
You can do something like:
subprojects {
dependencies {
if (!project.name == "service-common") {
implementation(project(":service-common"))
}
}
}
I have a Spring Boot application backed with Kotlin as the language, and Gradle as the build system. So basically I'm trying to build a fat jar out of the application source and dependencies, which can be run using Java command line tool.
Gradle build script:
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: "kotlin-spring"
apply plugin: 'org.springframework.boot'
group 'myapp'
version '1.0'
buildscript {
ext.kotlin_version = '1.2.21' // Required for Kotlin integration
ext.spring_boot_version = '1.5.4.RELEASE'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Required for Kotlin integration
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" // See https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version"
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin/'
test.java.srcDirs += 'src/test/kotlin/'
}
jar {
zip64 true
manifest {
attributes 'Main-Class': 'app.main.ApplicationKt'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile("org.jetbrains.kotlin:kotlin-reflect")
compile group: 'com.typesafe', name: 'config', version: '1.3.2'
compile 'org.springframework.boot:spring-boot-starter-web'
compile group: 'org.apache.camel', name: 'camel-spring-boot-starter', version: '2.20.2'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '2.0.0.RELEASE'
compile group: 'org.apache.camel', name: 'camel-quartz2', version: '2.20.2'
compile group: 'org.apache.camel', name: 'camel-http4', version: '2.20.2'
compile group: 'org.apache.camel', name: 'camel-docker', version: '2.20.2'
compile group: 'org.apache.camel', name: 'camel-aws', version: '2.20.2'
compile group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0'
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
compile group: 'net.gpedro.integrations.slack', name: 'slack-webhook', version: '1.4.0'
compile group: 'org.json', name: 'json', version: '20180130'
compile group: 'org.jfree', name: 'jfreechart', version: '1.5.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
If I run the project using gradle command then it runs fine. But when I build the jar and try ti run it complains with the below error:-
Error: Could not find or load main class app.main.ApplicationKt
Application.kt:-
#SpringBootApplication
#ImportResource("classpath*:camel-context.xml")
#ComponentScan("app")
class Application
fun main(args:Array<String>){
SpringApplication.run(Application::class.java, *args)
}
Not sure where exactly I'm doing anything wrong.
In Application.kt, you do not have a package declaration. From the documentation:
All the contents (such as classes and functions) of the source file are contained by the package declared. So, in the example above, the full name of baz() is foo.bar.baz, and the full name of Goo is foo.bar.Goo.
If the package is not specified, the contents of such a file belong to "default" package that has no name.
You can look into the build/classes directory to inspect what packages the classes were compiled into.
To fix this issue, add package app.main to the top of the Application.kt file.
for some reason I encountered the same error but my package was declared. I copied the package deleted the line and pasted, saved, reloaded the project and the application ran. I don´t have a logical explanation for this, but that is how I solved this error.
While trying to connect to Spring Websocket with SockJS, I am getting an error
org.springframework.web.util.NestedServletException: Request processing failed;
nested exception is org.springframework.web.socket.sockjs.SockJsException:
Uncaught failure in SockJS request, uri=http://localhost:8083//subscribe/info/771/nay07fet/websocket;
nested exception is org.springframework.web.socket.sockjs.SockJsTransportFailureException:
WebSocket handshake failure; nested exception is java.lang.ClassCastException:
org.eclipse.jetty.websocket.jsr356.server.ServerContainer cannot be cast
to org.apache.tomcat.websocket.server.WsServerContainer
From online I figured out that I shall disable Tomcat in Classpath to overcome it, but no matter how I try, I can not get rid of Tomcat.
How I can reliably exclude tomcat from any project? Note that I found it in several places.
My current Dependency tree is here: http://pastebin.com/pH1iQejd
and it contains some tomcat. I need to get rid of everything that might cause that type confusion.
Here's my gradle.build (I tried some exlcudes but without success):
group 'com.company'
if (!hasProperty("buildNumber")) {
version "1.0.0-SNAPSHOT"
} else {
version "1.0.${buildNumber}-SNAPSHOT"
}
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE")
classpath("gradle.plugin.com.boxfuse.client:flyway-release:4.0.1")
classpath fileTree(dir: 'libs', include: '*.jar')
classpath fileTree(dir: 'src/main/resources/db/migration', include: '*.sql')
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2"
}
}
dependencies {
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
exclude module: 'spring-boot-starter-logging'
}
compile("org.springframework.boot:spring-boot-starter-jetty") {
exclude module: "spring-boot-starter-tomcat"
exclude module: 'spring-boot-starter-logging'
}
// end::jetty[]
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.boot:spring-boot-starter-data-jpa"){
exclude module: "spring-boot-starter-tomcat"
exclude module: 'spring-boot-starter-logging'
}
compile("org.springframework.boot:spring-boot-starter-data-rest")
compile("org.springframework.boot:spring-boot-starter-websocket")
// http://mvnrepository.com/artifact/org.springframework.security/spring-security-core
compile group: 'org.springframework.security', name: 'spring-security-core', version: '4.1.0.RELEASE'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.+'
compile group: 'com.google.code.gson', name: 'gson', version: '2.5'
compile group: 'com.rabbitmq', name: 'amqp-client', version: '3.5.6'
compile group: 'commons-configuration', name: 'commons-configuration', version: '1.9'
compile group: 'com.google.guava', name: 'guava', version: '18.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.5'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.5'
compile("org.springframework:spring-messaging")
compile 'org.springframework.amqp:spring-rabbit:1.5.5.RELEASE'
compile("com.h2database:h2")
compile 'org.quartz-scheduler:quartz:2.2.1'
compile group: 'joda-time', name: 'joda-time', version: '2.3'
//compile("com.npspot:jtransit-light:1.0.6")
compile("io.fastjson:boon:0.33")
compile fileTree(dir: 'libs', include: '*.jar')
// end::actuator[]
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile("org.springframework.boot:spring-boot-starter-test")
}
configurations {
compile.exclude module: "spring-boot-starter-tomcat"
compile.exclude module: 'spring-boot-starter-logging'
runtime.exclude module: "spring-boot-starter-tomcat"
runtime.exclude module: 'spring-boot-starter-logging'
}
test {
reports {
junitXml.enabled = true
html.enabled = false
}
}
springBoot {
executable = true
}
I was facing this problem as well. I solved it by adding the exclude clause to the websocket dependency, i.e.:
compile("org.springframework.boot:spring-boot-starter-websocket") {
exclude module: "spring-boot-starter-tomcat"
}
After this, I realized it wasn't necessary to have the exclusion on all the other ones; it's only necessary on starter-web and starter-websocket.