如何手动将jar安装到本地Maven存储库? [英] How do I manually install a jar to my local Maven repository?
问题描述
我想在我的maven项目中使用 Google的GXP库.我是Maven的新手,因为.jar在Maven存储库中尚不可用,因此遇到了很多麻烦.通过阅读,我应该能够在我的本地存储库中安装jar,然后再使用它.但是,我遇到了很多麻烦.有人知道我可能在哪里出问题了吗?
I'd like to use Google's GXP library in my maven project. I'm new to Maven and having quite a bit of trouble since the .jar is not available in a Maven repository already. From what I've read I should be able to install the jar in my local repository and then make use of it. However, I'm having quite a bit of trouble. Anyone know where I might have gone wrong?
PS C:\Documents and Settings\bmccann\Desktop> mvn install:install-file -Dfile=gxp-0.2.4-beta.jar -DgroupId=com.google -DartifactId=gxp -Dversion=0.2.4-BETA -Dpackaging=jar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Invalid task '.2.4-beta.jar': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersi
on:goal
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time:
推荐答案
感谢您的建议.我在发布之前已经尝试过这两种方法,但都没有用.事实证明,这对我不起作用,因为我正在使用Windows PowerShell.如果我使用标准命令控制台,那么它可以正常工作.我想PowerShell或Maven中都存在一个错误,无法使两者正确交互.
Thanks for the suggestion. I had tried both of those before posting and neither worked. It turns out this wasn't working for me because I was using Windows PowerShell. If I used the standard command console then it worked fine. I guess there's a bug in either PowerShell or Maven that won't let the two interact properly.
这篇关于如何手动将jar安装到本地Maven存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!