使用 Apache Camel 依赖项升级 Spring 启动应用程序时出现问题

Issue in upgrading Spring Boot App with Apache Camel Dependencies

我们的应用程序目前 运行 spring boot 1.5.10.RELEASE 版本,我正在尝试升级到 spring boot 2.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"
 }

我想知道这是否是由于我尝试使用 Spring 引导版本 1.5.22 时的骆驼依赖性。它工作正常,但一旦我将其更改为 2.x.x,它就会停止工作。

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