在 maven install:install-file 中使用 Windows 驱动器盘符
当我尝试使用以下 maven 命令安装自定义 jar 时,它将失败:
mvn -X install:install-file -Dfile=D:\Work\...
然而,以下命令确实有效:
mvn -X install:install-file -Dfile=\Work\...
您现在可能会问: 那么问题出在哪里?好吧,我想从脚本文件导入,那里有带有驱动器号和所有其他修饰的路径。
那么我该怎么办呢?
PS:错误信息是:
[错误] 找不到前缀“D”的插件 在当前项目和>中插件组 [org.apache.maven.plugins,org.code haus.mojo] 可从 存储库 [本地(D:\Repository), 中央 (http://repo1.maven.org/maven2)] -> [帮助1] org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: 未找到前缀“D”的插件 当前项目和插件中 组 [org.apache.maven.plugins, org.codehaus.mojo] 可从 存储库
PPS:该公司的该死的 IE 中没有拼写检查器:-(
When I try to install a custom jar with the following maven command then it will fail misirably:
mvn -X install:install-file -Dfile=D:\Work\...
Howerver the following does work:
mvn -X install:install-file -Dfile=\Work\...
You might now ask: So where is the problem? Well, I want to import from a script file and there I have the path with drive letter and all other trimmings.
So how would I go about this?
PS: The error message is:
[ERROR] No plugin found for prefix 'D'
in the current project and in the> plugin groups
[org.apache.maven.plugins, org.code
haus.mojo] available from the
repositories [local (D:\Repository),
central
(http://repo1.maven.org/maven2)] ->
[Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException:
No plugin found for prefix 'D' in the
current project and in the plugin
groups [org.apache.maven.plugins,
org.codehaus.mojo] available from the
repositories
PPS: No spell checker in the companies bloody IE :-(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
最后我选择:
我使用:
我希望这有帮助。
In the end I opted for:
I used:
I hope that helps.
我遇到了一个非常类似的错误,除了我的前缀是“C”...
阅读此线程后,我在 jar 文件名中添加了单引号 -
Dfile='C:\work\perforce\trunk\Lib\ ftp4j\ftp4j-1.7.2.jar'
并且您需要确保=
和'
之间没有空格。添加单引号修复了它,并且我能够在安装后将
"BUILD SUCCESS"
作为我的输出。但猜猜我在存储库文件夹中看到了什么?
ftp4j-1.7.2.jar.lastUpdated
、ftp4j-1.7.2.pom
、ftp4j-1.7.2.pom.lastUpdated
文件都是通过安装在文件夹中创建的,但实际的ftp4j-1.7.2.jar
没有/无法复制...所以此时,我只需手动复制ftp4j-1.7.2.jar
通过我自己到存储库,这似乎终于起作用了。I got a very similar error except my was prefix 'C'...
After reading this thread, I added single quotation mark to my jar file name as -
Dfile=‘C:\work\perforce\trunk\Lib\ftp4j\ftp4j-1.7.2.jar’
and you need to make sure there is no space between the=
and the'
.Adding the single quotes fixed it and I was able to have
"BUILD SUCCESS"
as my output after the install.But guess what I see in my repository folder? The
ftp4j-1.7.2.jar.lastUpdated
,ftp4j-1.7.2.pom
,ftp4j-1.7.2.pom.lastUpdated
files were all created in the folder by the installation, but the actualftp4j-1.7.2.jar
was NOT/failed to copy over...So at this point, I just manually copy theftp4j-1.7.2.jar
over myself to the repository and that seems to finally work.我在使用 PowerShell 时遇到了这个问题,但不知怎的,当我使用命令提示符时它就解决了......
I had this problem using PowerShell, but somehow, it was resolved when I used Command Prompt...
您可以尝试使用有效的 Java 路径字符串吗?
Could you try by using a valid Java path string ?
ojdbc6.jar 安装示例(在 Windows 上)。
从 甲骨文。接下来在“Command Shell”中发出命令
Example for ojdbc6.jar install (on Windows).
Download ojdbc drivers from Oracle. Next in "Command Shell" issue command