1. 报错说明
我在使用下述指令下载本地依赖,装进pom.xml中的时候报错了
mvn install:install-file -Dfile=D:/omni-channel-recon-dev/reference-project/edax/abcpay-sdk-java/lib/jsse.jar -D"groupId=com.abcpay.sdk" -DartifactId=jsse -Dversion=3.1.7 -Dpackaging=jar
<dependency>
<groupId>com.abcpay.sdk</groupId>
<artifactId>jsse</artifactId>
<version>3.1.7</version>
</dependency>
报错:
Unknown lifecycle phase ".abcpay.sdk". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Av
ailable lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, p
rocess-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]
报错原因:mvn install:install-file
命令报错的原因可能是 -D
选项的参数解析出了问题,通常是因为 Windows 命令行解析 -DgroupId=com.abcpay.sdk
时, .
可能被误认为是 mvn
的分隔符之一,从而导致 Unknown lifecycle phase “.abcpay.sdk” 的错误。
2. 解决方案
用""
包裹-D参数:
mvn install:install-file -Dfile=D:/omni-channel-recon-dev/reference-project/edax/abcpay-sdk-java/lib/jsse.jar -D"groupId=com.abcpay.sdk" -DartifactId=jsse -Dversion="3.1.7" -Dpackaging=jar