我有一个.jar工件,这在技术上是一个DAO层,它是用一个较旧的技术栈构建的。
我想将这个.jar作为一个依赖项添加到我的新spring 2.x项目中,并将其用作应用程序的数据层。
新的应用程序技术栈:
根据我的理解,我将旧的jar作为一个依赖项添加到我的build.gradle中,并且排除了spring-orm模块。但是gradle仍然使用最新版本,而不是在旧的.jar依赖项中使用该版本。
build.gradle
group = 'com.test.app'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
maven{
credentials {
username = "$nexusUsername"
password = "$nexusPassword"
}
url "$nexusUrl"
}
}
// exluded spring-orm from spring boot 2.x
configurations {
compile.exclude module: 'spring-orm'
}
dependencies {
// my older dao dependency
implementation "com.my.older.core:dao:0.3.8-SNAPSHOT"
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}不知怎么的,我需要让这个应用程序使用较早的orm版本,而不是spring 2.x中的新版本,因为dao .jar使用的是旧版本。
这方面的任何线索都将不胜感激。谢谢。
发布于 2019-03-08 08:28:19
configurations.all {
resolutionStrategy.force 'org.springframework:spring-orm:oldversion'
}希望这能有所帮助
https://stackoverflow.com/questions/55058890
复制相似问题