为什么mvn安装Oracle JDBC ojdbc6 Jar总是有';未找到前缀为';错误,mvn构建失败?

为什么mvn安装Oracle JDBC ojdbc6 Jar总是有';未找到前缀为';错误,mvn构建失败?,oracle,maven,jdbc,Oracle,Maven,Jdbc,我通过以下两个链接下载ojdbc jar并在Windows系统中本地安装: 我最终使用下面的命令(使用`to escape-): 但我仍然发现以下错误: [ERROR] No plugin found for prefix '`-Dfile=C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositori

我通过以下两个链接下载ojdbc jar并在Windows系统中本地安装:

  • 我最终使用下面的命令(使用`to escape-):

    但我仍然发现以下错误:

    [ERROR] No plugin found for prefix '`-Dfile=C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\peter\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
    
    另外,尽管通过上述操作看起来很像,但ojdbc jar安装在.m2/repository下,当我对项目运行mvn安装时,我仍然得到:

    Failure to find com.oracle:ojdbc6:jar:11.2.0.2.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
    

    如何解决此问题?

    为什么要在命令中添加反引号(`)?试着在没有反报价的情况下运行它

    mvn install:install-file -Dfile=C:\Users\xxx\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=true
    

    [错误]无法执行目标org.apache.maven.plugins:maven安装插件:2.4:project Except测试上的安装文件(默认cli):指定的文件“C:\Users\xxx\Downloads\ojdbc6.jar”不存在->[Help 1]如我的第二个链接中所述,在windows cmd窗口中,如果不添加backtick,您将看到上述错误。它也发生在powershell中。您是否在基本cmd中尝试过不使用反引号?你的链接只提到Powershell,事实上…是的。事实上,我试过使用basic cmd,尽管文章说它适用于powershell。相同的行为。您是否尝试从jar所在的文件夹执行
    mvn
    ,以不使用驱动器名的完整路径?@Ivan是,输入命令并指定mvn路径的行为相同:
    C:\apache maven\bin\mvn安装:安装文件-Dfile=C:\Users\xxx\ojdbc6.jar-DgroupId=com.oracle-DartifactId=ojdbc6-Dversion=11.2.0.2.0-dpackage=jar-DgeneratePom=true
    mvn install:install-file -Dfile=C:\Users\xxx\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -DgeneratePom=true