Gradle: created jar by gradle task bootJar is not working

Vipul :

I am creating a spring boot application with the following properties the project is running successfully when I run projects with Gradle bootrun it is running successfully but when i create a jar and deploy its not working here is my build.gradle

I have checked all the versions of my project are same.

Error :Error mapping to ad-hoc class .. At present, only @Result types that are discovered by the domain entity package scanning can be mapped.;
nested exception is org.neo4j.ogm.exception.core.MappingException: Error mapping to ad-hoc class com.vipul....  At present, only @Result types that are discovered by the domain entity package scanning can be mapped

PS: I KNOW ABOUT QUERY RESULT mapping but its working with bootRun but not with bootJar

buildscript {
  ext {
    springBootVersion = '2.0.5.RELEASE'
    swaggerVersion = '2.5.0'
    jacksonVersion = '2.9.2'
    projectVersion = "0.0.1"
    version = "0.0.1"
  }
  repositories {
    mavenCentral()
    jcenter()
    maven {
        url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  }
}

apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: "io.spring.dependency-management"
apply plugin: 'idea'
apply plugin: 'application'
version = "$projectVersion-SNAPSHOT"
sourceCompatibility = 1.8
mainClassName = 'com.vipul.Application'
applicationDefaultJvmArgs = ["-Xdiag"]
repositories {
  mavenCentral()
  jcenter()
  maven { url "https://plugins.gradle.org/m2/" }
  maven{ url "https://repo.spring.io/plugins-release"}
}
task wrapper(type: Wrapper) { gradleVersion = '4.4' }

ext {
    springCloudVersion = 'Finchley.RELEASE'
}

dependencies {
  compile('org.springframework.boot:spring-boot-starter-aop')
  compile('org.springframework.boot:spring-boot-starter-cache')
  compile('org.springframework.boot:spring-boot-starter-data-neo4j')
}

dependencyManagement {
  imports {
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
  }
}
Yasir :

Try changing springBoot and springCloud versions in your build.gradle

**

springBootVersion='2.0.0.RELEASE'

**

It seems to be problem with spring boot version. springBootVersion = '2.0.5.RELEASE'

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=103620&siteId=1