猿问

导入org.apache.cxf无法解析Java

我是 Java/SpringBoot 新手。


我刚刚用 Gradle 创建了一个 SpringBoot 项目,但无法使用:


import org.apache.cxf.configuration.jsse.TLSClientParameters;

import org.apache.cxf.endpoint.Client;

import org.apache.cxf.frontend.ClientProxy;

import org.apache.cxf.transport.http.HTTPConduit;

我尝试使用 gradle 导入 apache cxf:

compile group: 'org.apache.cxf', name: 'cxf', version: '3.3.3', ext: 'pom'

在 build.gradle 中,然后:

  1. 使用 VSCode 自动构建

  2. 手动构建gradlew build

然后我还是无法使用org.apache.cxf

我缺少什么?



幕布斯6054654
浏览 165回答 1
1回答

红颜莎娜

根据我所看到的,依赖关系应该是:&nbsp; &nbsp; <dependency>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.apache.cxf</groupId>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <artifactId>cxf-rt-frontend-jaxws</artifactId>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <version>x.x.x</version>&nbsp;&nbsp;&nbsp; &nbsp; </dependency>&nbsp;&nbsp;&nbsp; &nbsp; <dependency>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <groupId>org.apache.cxf</groupId>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <artifactId>cxf-rt-transports-http</artifactId>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; <version>x.x.x</version>&nbsp; &nbsp; </dependency>&nbsp;&nbsp;或者在 Gradle 语法中:dependencies {&nbsp; &nbsp; compile 'org.apache.cxf:cxf-rt-frontend-jaxws:x.x.x'&nbsp; &nbsp; compile 'org.apache.cxf:cxf-rt-transports-http:x.x.x'
随时随地看视频慕课网APP

相关分类

Java
我要回答