使用Apache Camel Dependencies升级Spring Boot应用程序时出现问题



我们的应用程序当前运行在spring-boot1.5.10.RELEASE版本上,我正试图升级到spring-boot2.0.0.RELEASE,但升级到2.0.0.RELEASE后,我收到以下错误

Error: Could not find or load main class com.app.MyApplication

下面给出的是build.gradle文件

buildscript {
ext {
springBootVersion = '2.0.0.RELEASE'
camelVersion = '2.24.0'
}
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.spring.io/snapshot" }
maven { url "http://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
apply from: '../common.gradle'
apply from: '../test.gradle'
apply plugin: 'org.springframework.boot'
apply plugin: 'war'
apply plugin: 'io.spring.dependency-management'
dependencies {
providedRuntime "org.springframework.boot:spring-boot-starter-tomcat"
compile ("org.flywaydb:flyway-core:5.0.7")
compile ("org.springframework.retry:spring-retry:1.2.2.RELEASE")
compile("org.springframework:spring-jms:5.1.1.RELEASE")
compile("org.springframework.boot:spring-boot-starter-activemq:2.0.6.RELEASE")
compile("org.springframework:spring-jdbc:5.0.4.RELEASE")
compile("org.springframework.retry:spring-retry:1.2.2.RELEASE")
compile("com.amazonaws:aws-java-sdk-sqs:1.11.428")
compile("com.amazonaws:amazon-sqs-java-messaging-lib:1.0.4")
compile ("org.flywaydb:flyway-core:5.0.7")
runtime("org.apache.activemq:activemq-kahadb-store:5.15.6") 
compile("org.apache.camel:camel-spring-boot-starter:${camelVersion}")
compile("org.apache.camel:camel-core:${camelVersion}")
compile("org.apache.camel:camel-http-starter:${camelVersion}")
compile("org.apache.camel:camel-http4:${camelVersion}")
compile("org.apache.camel:camel-jsonpath:${camelVersion}")
compile("org.apache.camel:camel-jackson:${camelVersion}")
compile("org.apache.camel:camel-base64:${camelVersion}")
compile("org.apache.camel:camel-groovy:${camelVersion}")
compile("org.apache.camel:camel-jolt:${camelVersion}")
compile("org.apache.camel:camel-jaxb:${camelVersion}")
compile("org.apache.camel:camel-ahc:${camelVersion}")
compile("org.codehaus.groovy:groovy-json:3.0.3")               
}
configurations {
all*.exclude group: '', module: 'servlet-api'
}
springBoot {
mainClassName = 'com.app.MyApplication'
}
war {
archiveName = "application.war"
}

我想知道这是否是由于camel依赖关系,就像我尝试使用SpringBoot版本1.5.22时一样。它运行良好,但一旦我将其更改为2.x.x,它就会停止工作。

当我在Intellij而不是eclipse中运行此应用程序时,这个问题得到了解决。

最新更新