2014-11-05 80 views
3

我想JDBC甲骨文添加到Maven仓库“安装”,因为它不是在库无插件,我要运行这个命令:发现前缀在当前项目

mvn install:install-file 
-Dfile=D:\Temp\ojdbc6.jar 
-DgroupId=com.oracle 
-DartifactId=ojdbc6 - 
Dversion=11.2.0 -Dpackaging=jar 

碰上这个错误:

[ERROR] No plugin found for prefix 'install' in the current project and in the p 
lugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the re 
positories [local ({my repository path}), central (https://repo.maven. 
apache.org/maven2)] 

任何帮助将被占用。

+1

这个答案应该给你一个想法:http://stackoverflow.com/a/26378059/1570834。只需用'install'替换'help',答案就是有效的。 – DB5 2014-11-05 08:33:39

+0

@ DB5我阅读答案,并检查每一件事情。每件事似乎都是正确的,我不知道什么是错误的。 – Narges 2014-11-05 10:22:28

+0

当您使用调试标志时,您会看到什么? (即'mvn -X install:install-file ...')。你有没有尝试删除你的本地存储库并再次尝试? – DB5 2014-11-05 10:58:53

回答

0

我也面临着同样的问题,有两个步骤来解决此问题:

  1. 配置Maven代理配置

    1. 打开Maven配置文件:

      • 对于Linux:${user.home}/.m2/settings.xml
      • 对于Windows:C:\users\username\.m2\settings.xml

      • 如果你能找到的文件,打开它,然后搜索<proxies></proxies>段。

      • 如果无法找到该文件,创建一个名为settings.xml新文件,并添加下列XML标记<settings></settings>

      • 添加代理服务器配置如下:

        <proxies> 
            <proxy> 
             <id>example-proxy</id> 
             <active>true</active> 
             <protocol>http</protocol> 
             <host>proxy.example.com</host> 
             <port>8080</port> 
             <username>proxyuser</username> 
             <password>somepassword</password> 
            <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts> 
            </proxy> 
        </proxies> 
        
  2. 更新带有工作分机的Maven库

现在,您可以使用Maven与您的程序。