有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java客户端生成器。运行maven build时,JDK 9+不支持sslSocketFactory(sslSocketFactory)

我已经将一个现有的maven项目导入eclipse。当我尝试构建maven项目时,会出现错误“clientBuilder”。JDK 9+消息不支持sslSocketFactory(sslSocketFactory)。我已经安装了JDK 8和Maven版本“ApacheMaven 3.0.5”。Eclipse版本是光子里程碑3(4.8.0M3)。 我的POM文件如下所示

有人能帮我解决这个问题吗

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>NBE_Proxibid</groupId> <artifactId>NBE_Proxibid</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>NBE_Proxibid</name> <url>http://maven.apache.org</url> <build> <sourceDirectory>src</sourceDirectory> <resources> <resource> <directory>src</directory> </resource> </resources> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19.1</version> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>5.0.4</version> </dependency> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.13.0</version> </dependency> <!-- JFreeChart is a class library, currently supporting bar charts, pie charts, line charts, XY-plots and time series plots. --> <dependency> <groupId>org.jfree</groupId> <artifactId>jfreechart</artifactId> <version>1.5.0</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.13.1</version> <!-- <scope>test</scope> --> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.17</version> </dependency> <!-- <dependency> <groupId>com.relevantcodes</groupId> <artifactId>extentreports</artifactId> <version>2.41.2</version> </dependency> --> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>3.1.5</version> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.7</version> </dependency> <dependency> <groupId>com.itextpdf.tool</groupId> <artifactId>xmlworker</artifactId> <version>5.4.1</version> </dependency> <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>3.0.6</version> </dependency> <!-- https://mvnrepository.com/artifact/org.json/json --> <dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20171018</version> </dependency> <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency> <!-- https://mvnrepository.com/artifact/ru.yandex.qatools.ashot/ashot --> <dependency> <groupId>ru.yandex.qatools.ashot</groupId> <artifactId>ashot</artifactId> <version>1.5.4</version> </dependency> <!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 --> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>4.0</version> </dependency> <dependency> <groupId>com.opencsv</groupId> <artifactId>opencsv</artifactId> <version>4.1</version> </dependency> </dependencies> </project>

这是我得到的错误:

[INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.490 s [INFO] Finished at: 2021-05-19T18:12:53+05:30 [INFO] Final Memory: 12M/243M [INFO] ------------------------------------------------------------------------ [ERROR] clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+ [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging.

共 (1) 个答案

  1. # 1 楼答案

    这个问题在我安装Eclipse氧气后得到了解决。事实证明,这是我在eclipse构建中遇到的插件问题