依赖项构建 gradle 重复

问题描述 投票:0回答:1

我正在使用 api Soap 创建一个 Spring Boot 项目,并且使用两个相互之间存在重复冲突的依赖项。

错误日志消息:

任务“:war”执行失败。

条目 WEB-INF/lib/jaxb-core-4.0.5.jar 是重复的,但未设置重复处理策略。详情请参阅 https://docs.gradle.org/8.8/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy

我使用这个依赖项:

  • 实现“com.sun.xml.ws:jaxws-ri:2.3.3”
  •   implementation 'javax.xml.ws:jaxws-api:2.3.1'
    

我希望继续使用两者来解决问题

spring api soap
1个回答
0
投票

如果我在评论中回复,我很抱歉,但我不知道在哪里编辑请求...

这是我的 build.gradle 文件:

plugins {
    id 'java'
    id 'war'
    id 'org.springframework.boot' version '3.3.1'
    id 'io.spring.dependency-management' version '1.1.5'
}

group = 'eu.tecnosoft'
version = '0.0.1-SNAPSHOT'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

task run(type: JavaExec) {
    main = 'eu.tecnosoft.licensemanager.LicensemanagerApplication'
    classpath = sourceSets.main.runtimeClasspath
}

repositories {
    mavenCentral()
}

apply plugin: 'war'

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
    implementation 'org.json:json:20211205'
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.1'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3'
    implementation group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: '1.78.1'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web-services', version: '3.3.3'

    implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.5'
    implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.5'
    implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.5'
    implementation group: 'wsdl4j', name: 'wsdl4j', version: '1.6.2'

    implementation 'com.sun.xml.ws:jaxws-ri:2.3.3'
    implementation 'javax.xml.ws:jaxws-api:2.3.1'

    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
    useJUnitPlatform()
}

bootWar {
    archiveFileName = 'licensemanager.war'
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
© www.soinside.com 2019 - 2024. All rights reserved.