我想在我的maven项目中使用Google's GXP library . 我'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'已读过我应该能够在我的本地存储库中安装jar然后再使用它 . 但是,我遇到了很多麻烦 . 谁知道我可能出错了?
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:
2 回答
您正在使用的命令没问题 . 我只是复制并粘贴它并在我的本地存储库中成功安装了相同的新下载的jar:
所以你必须对
maven-install-plugin
插件有问题(可能在下载不完整后损坏) . 删除~/.m2/repository/org/apache/maven/plugins/maven-install-plugin
(或~/.m2/repository/org/apache/maven
下的更多内容)并再试一次 .谢谢你的建议 . 在发布之前我曾尝试过这两个,但都没有奏效 . 事实证明,这对我不起作用,因为我使用的是Windows PowerShell . 如果我使用标准命令控制台,那么它工作正常 . 我想PowerShell或Maven中都存在一个错误,它不会让两者正常交互 .