Gradle:由 gradle 任务创建的 jar bootJar 不工作
Gradle: created jar by gradle task bootJar is not working
我正在创建一个具有以下属性的 spring 启动应用程序,当我 运行 使用 Gradle 启动 运行 项目时,该项目 运行ning 成功它 运行ning 成功了,但是当我创建一个 jar 并部署它时它在这里不起作用是我的 build.gradle
我检查过我的项目的所有版本都相同。
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:我知道查询结果映射,但它与 bootRun 一起使用但与 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}"
}
}
尝试在 build.gradle
中更改 springBoot 和 springCloud 版本
**
springBootVersion='2.0.0.RELEASE'
**
spring 启动版本似乎有问题。 springBootVersion = '2.0.5.RELEASE'
我正在创建一个具有以下属性的 spring 启动应用程序,当我 运行 使用 Gradle 启动 运行 项目时,该项目 运行ning 成功它 运行ning 成功了,但是当我创建一个 jar 并部署它时它在这里不起作用是我的 build.gradle
我检查过我的项目的所有版本都相同。
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:我知道查询结果映射,但它与 bootRun 一起使用但与 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}"
}
}
尝试在 build.gradle
中更改 springBoot 和 springCloud 版本**
springBootVersion='2.0.0.RELEASE'
**
spring 启动版本似乎有问题。 springBootVersion = '2.0.5.RELEASE'