Java 以前工作程序上的Gradle生成错误
我有一个jave8,SpringBoot,webService,它在eclipse2020-06上已经运行了好几个月了。我使用Gradle构建。为了从Artifactory获取更新jar文件的最新版本,我做了以下操作:Java 以前工作程序上的Gradle生成错误,java,eclipse,spring-boot,gradle,Java,Eclipse,Spring Boot,Gradle,我有一个jave8,SpringBoot,webService,它在eclipse2020-06上已经运行了好几个月了。我使用Gradle构建。为了从Artifactory获取更新jar文件的最新版本,我做了以下操作: gradlew clean gradlew eclipse F5 (Refresh) 这确实提取了所需的jar文件,但我的程序现在无法编译。错误是: The import org.springframework.beans.factory.annotation cannot b
gradlew clean
gradlew eclipse
F5 (Refresh)
这确实提取了所需的jar文件,但我的程序现在无法编译。错误是:
The import org.springframework.beans.factory.annotation cannot be resolved
现在我所有的@Autowired命令都出错了。
我所尝试的:
gradlew cleanEclipse eclipse
以下jar已从我的项目中消失:
spring-beans.5.3.0.RC1.jar
这就是造成问题的原因。
build.gradle中是否存在此错误:
implementation "org.springframework:spring-beans:5.+"
我怎么把这个罐子拿回来?
谢谢你的帮助。
我的build.gradle文件是:
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'java'
}
repositories {
maven {
url "https://repo-int.xxxxxx.io/artifactory/cc-central"
}
maven {
url "https://code.lds.org/nexus/content/groups/main-repo"
}
maven {
url "${chemaxonRepositoryUrl}/libs-release"
credentials {
username = chemaxonRepositoryUser
password = chemaxonRepositoryPassword
}
}
}
ext {
archive_basename = "dcrws"
project_description = "Chemistry Workbench DcrWs"
springStarterVersion = '2.2.2.RELEASE'
// Jenkins/Environment Information
build_tag = System.getenv('BUILD_TAG') ?: "none"
build_by = System.getenv('NODE_NAME') ?: "none"
build_date = System.getenv('BUILD_TIMESTAMP') ?: "none"
build_system = System.getenv('JENKINS_HOME') ?: "none"
build_url = System.getenv('BUILD_URL') ?: "none"
build_user = System.getenv('USER') ?: "none"
}
// standard plugins
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'io.spring.dependency-management'
def git_info = hasProperty('git_info') ? git_info : 'https://git.git/repo,00000000'
def full_version = hasProperty('app_version') ? app_version : '0.0.0'
group = 'com.clarivate.singularity.chemworkbench'
version = full_version
archivesBaseName = ext.archive_basename
sourceCompatibility = 1.8
targetCompatibility = 1.8
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
// if master branch, use latest version of chemcur:cwbcommon, else use 0.0+ version
ext.cwbcommon_version = '1.+'
if ( full_version =~ /^0./) { ext.cwbcommon_version = '0.0+' }
ext.pwbcommon_version = '1.+'
if ( full_version =~ /^0./) { ext.pwbcommon_version = '0.0+' }
dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator:$springStarterVersion"
implementation "org.springframework.boot:spring-boot-starter-web:$springStarterVersion"
implementation "org.springframework.boot:spring-boot-starter-cache:$springStarterVersion"
implementation "org.springframework.boot:spring-boot-starter-data-jdbc:$springStarterVersion"
implementation "org.springframework.boot:spring-boot-starter-data-jpa:$springStarterVersion"
implementation "org.springframework.boot:spring-boot-starter-tomcat:$springStarterVersion"
implementation 'com.fasterxml.jackson.core:jackson-core:2.+'
implementation "org.springframework:spring-beans:5.+"
implementation "org.springframework:spring-core:5.+"
implementation "javax.servlet:javax.servlet-api:4.+"
implementation "org.apache.commons:commons-lang3:3.9+"
implementation "commons-dbutils:commons-dbutils:1.7+"
implementation "com.oracle:ojdbc6:11.2.0.1.0"
compile 'com.chemaxon:calculations:20.+'
// homegrown libs
compile ("chemcur:cwbcommon:${cwbcommon_version}") {changing = true}
compile ("chemcur:pwbcommon:${pwbcommon_version}") {changing = true}
developmentOnly "org.springframework.boot:spring-boot-devtools:$springStarterVersion"
}
springBoot {
buildInfo {
properties {
artifact = archive_basename
version = full_version
group = group
name = project_description
additional = [
'Implementation-Title': project_description,
'Implementation-Version': full_version,
"Implementation-SCM": git_info,
"Jenkins-Build-Tag": build_tag,
"Build-By": build_by,
"Build-Date": build_date,
"Build-JDK": System.getProperty('java.version'),
"Build-Gradle-Version": project.gradle.gradleVersion,
]
}
}
}
尝试在eclipse之外进行此操作,一旦构建完成,请检查eclipse配置的错误。还可以尝试删除.gradle文件夹并进行干净的生成。是否可以通过github提供项目?将以下内容添加到build.gradle?:编译'com.fasterxml.jackson.core:jackson注释:2.+'谢谢你的建议。我试过了,但没用。对不起,安妮什B,我不允许这么做