我有一个.jar伪像,从技术上讲,它是使用较旧的技术堆栈建造的。
- Java 1.6
- 春季3.1.0.Release
- Hibernate 3.5.6-Final
- Maven
我想将此.jar添加为我的新Spring Boot 2.x项目中的依赖性,并用作应用程序的数据层。
新应用技术堆栈:
- Java 1.8
- Spring Boot 2.1.3
- 春季框架5
- gradle
根据我的理解,我在build.gradle中添加了较旧的罐子作为依赖性和排除的弹簧模块。但是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 Boot 2.X中的新版本,因为Dao .Jar使用了旧版本。
对此的任何潜在客户都将不胜感激。谢谢。
configurations.all {
resolutionStrategy.force 'org.springframework:spring-orm:oldversion'
}
希望这有帮助