You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Maven Spring Boot项目中添加本地Jar执行mvn install报错求助

Fixing Maven Install:install-file Plugin Error

Hey there, I can spot the issue right away—your command has garbled characters from using a Chinese dash instead of an English one, which is throwing Maven off. Let's break this down and fix it step by step:

What's Causing the Error?

The weird 鈥揇 in your command is a corrupted Chinese em dash (—) that Maven can't parse. It's interpreting this gibberish as a plugin prefix, hence the confusing error about "No plugin found for prefix '没Dfile='D'".

Corrected Command

Use English short hyphens (-) for all parameters, and stick to English quotes if you need to wrap your file path (you can even drop the quotes here since your path has no spaces):

mvn install:install-file -Dfile="D:\WS\APP_Latest\app\lib\Services.jar" -DgroupId=Services -DartifactId=Services -Dversion=1.0 -Dpackaging=jar

Verify the Installation

After running the fixed command, you can add this dependency to your pom.xml to use the jar in your Spring Boot project:

<dependency>
    <groupId>Services</groupId>
    <artifactId>Services</artifactId>
    <version>1.0</version>
</dependency>

Quick Checks to Avoid Future Issues

  • Always use English punctuation when writing Maven commands—no Chinese dashes, quotes, or special characters.
  • Confirm you're running the command from the exact directory where your pom.xml lives (you're already doing this, nice!).
  • Double-check that your jar file path is free of typos (drive letters, folder names, etc.).

内容的提问来源于stack exchange,提问作者Rajeswari Reddy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:49:12