Код: Выделить всё
Entry META-INF/MANIFEST.MF is a duplicate but no duplicate handling strategy has been set.
Код: Выделить всё
3:23:01 pm: Executing 'build --scan'...
> Task :compileJava
> Task :processResources UP-TO-DATE
> Task :classes
> Task :bootJarMainClassName
> Task :bootJar FAILED
4 actionable tasks: 3 executed, 1 up-to-date
Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':bootJar'.
> Entry META-INF/MANIFEST.MF is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
Код: Выделить всё
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes(
'Main-Class': 'com.example.backendapp.BackendAppApplication'
)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.named('test') {
useJUnitPlatform()
}
- Добавьте «duulatesStrategy = DuplicationsStrategy.EXCLUDE» внутри jar
- Понизить версию Gradle с 7.5.1 до 7.2
Подробнее здесь: https://stackoverflow.com/questions/745 ... rategy-has
Мобильная версия