在Maven Spring Boot项目中添加本地Jar执行mvn install报错求助
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.xmllives (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

