在当前项目中找不到前缀“安装”的插件

Nar*_*ges 7 installation jdbc maven

我想将 jdbc oracle 添加到 maven 存储库,因为它不在存储库中,我必须运行以下命令:

mvn install:install-file
-Dfile=D:\Temp\ojdbc6.jar 
-DgroupId=com.oracle 
-DartifactId=ojdbc6 -
 Dversion=11.2.0 -Dpackaging=jar
Run Code Online (Sandbox Code Playgroud)

并遇到此错误:

[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)] 
Run Code Online (Sandbox Code Playgroud)

任何帮助都会被挪用。

Ama*_*dey 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>
        
        Run Code Online (Sandbox Code Playgroud)
  2. 使用工作扩展更新 Maven 库

现在您已准备好在您的程序中使用 Maven。