为什么MVN TEST不支持设置TLS

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

我的jdk:11 我的专家:3.6.3

我尝试在cmd中使用命令:

mvn test -Djdk.tls.client.protocols=TLSv1.2
但它说

[ERROR] Unknown lifecycle phase ".client.protocols=TLSv1.2". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-arti
fact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-c
lasses, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integrat
ion-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]

但是,我的一些同事可以使用它。

我尝试搜索但没有结果。或者是关于jdk11的?

java maven testing tls1.2
1个回答
0
投票

请在之前指定您的 Java 选项目标和阶段。正如

mvn --help
所说:

usage: mvn [options] [<goal(s)>] [<phase(s)>]

所以正确的调用应该是:

mvn -Djdk.tls.client.protocols=TLSv1.2 test
© www.soinside.com 2019 - 2024. All rights reserved.