The goal you specified requires a project to execute but there is no POM in this directory

**maven导入本地jar包报错:The goal you specified requires a project to execute but there is no POM in this directory **

问题出现
项目中发现用到的jar包不是在远程仓库的中有的,是项目自己定义的jar包
使用install指令去进行本地jar包导入的时候出现以上问题
顾名思义没有pom文件,一开始我是直接在maven的bin目录下打开cmd进行指令的

C:\Program Files\maven\apache-maven-3.6.3\bin>mvn install:install-file -Dfile=C:\Program Files\maven\local jar\jeecms-core-v1.3.4.85t.jar -DgroupId=com.jeecms -DartifactId=jeecms-core -Dversion=v1.3.4.85t -Dpackaging=jar
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.092 s
[INFO] Finished at: 2021-07-28T17:31:49+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Program Files\maven\apache-maven-3.6.3\bin). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException

C:\Program Files\maven\apache-maven-3.6.3\bin>

解答
直接在我的项目中的src下,也就是存在pom文件的文件目录去打开cmd窗口即可

C:\Users\15259\Desktop\jeecms相关软件包\mysql_src\jeecms-parent\jeecms-common>mvn install:install-file -Dfile=C:\LocalJar\jeecms-core-v1.3.4.85t.jar -DgroupId=com.jeecms -DartifactId=jeecms-core -Dversion=v1.3.4.85t -Dpackaging=jar
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.jeecms:jeecms-common:jar:x1.10.0
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.boot:spring-boot-starter-test:jar -> duplicate declaration of version (?) @ line 332, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ----------------------< com.jeecms:jeecms-common >----------------------
[INFO] Building jeecms-common x1.10.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install-file (default-cli) @ jeecms-common ---
[INFO] pom.xml not found in jeecms-core-v1.3.4.85t.jar
[INFO] Installing C:\LocalJar\jeecms-core-v1.3.4.85t.jar to C:\Program Files\maven\repository\com\jeecms\jeecms-core\v1.3.4.85t\jeecms-core-v1.3.4.85t.jar
[INFO] Installing C:\Users\15259\AppData\Local\Temp\mvninstall2322130607649756614.pom to C:\Program Files\maven\repository\com\jeecms\jeecms-core\v1.3.4.85t\jeecms-core-v1.3.4.85t.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.873 s
[INFO] Finished at: 2021-07-28T17:43:25+08:00
[INFO] ------------------------------------------------------------------------
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值