在maven中导入jar包时出现的错误
错误报告:
在相应文件目录中找不到文件,发现文件名多了一个问号
[INFO] — maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom —
[ERROR] The specified file ‘C:\Users\Administrator\Desktop\lianpay_common_security-0.0.1.jar***?***-DgroupId=lianpay_common_security’ not exists
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.237 s
[INFO] Finished at: 2020-03-10T14:34:50+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The specified file ‘C:\Users\Administrator\Desktop\lianpay_common_security-0.0.1.jar?-DgroupId=lianpay_common_security’ not exists -> [Help 1]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
原因纠正
在复制命令行代码时,空格键输入错误 将空格键删除后重新输入 编译成功
成功后:
C:\Windows\System32>mvn install:install-file -Dfile=“C:\Users\Administrator\Desktop\lianpay_common_security-0.0.1.jar” -DgroupId=lianpay_common_security -DartifactId=lianpay_common_security -Dversion=0.0.1 -Dpackaging=jar
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] — maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom —
[INFO] Installing C:\Users\Administrator\Desktop\lianpay_common_security-0.0.1.jar to E:\jar\lianpay_common_security\lianpay_common_security\0.0.1\lianpay_common_security-0.0.1.jar
[INFO] Installing C:\Users\ADMINI~1\AppData\Local\Temp\mvninstall1108578841017892212.pom to E:\jar\lianpay_common_security\lianpay_common_security\0.0.1\lianpay_common_security-0.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.795 s
[INFO] Finished at: 2020-03-10T14:35:26+08:00
[INFO] ------------------------------------------------------------------------