【问题标题】:How to resolve dependency errors in Maven with Nexus repository如何使用 Nexus 存储库解决 Maven 中的依赖错误
【发布时间】:2012-01-12 18:01:43
【问题描述】:

我是 Maven/Nexus 的新手,所以希望这些是我希望的简单问题:

当我在我的项目上运行 mvn install 时,我收到以下错误:

[WARNING] Some problems were encountered while building the effective model for com.myproj.TestProj:jar:0.0.1
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 294, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 304, column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

还有第二个错误

[WARNING] The POM for oracle:ojdbc:jar:10.0.2.0 is missing, no dependency information available

对于第一个错误,我认为要我将版本信息添加到以下插件中

<plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <verbose>true</verbose>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>ISO-8859-1</encoding>
                </configuration>
            </plugin>

问题是我如何知道要指定哪个版本以及在哪里可以找到可用的版本?

关于丢失的oracle:ojdbc:jar:10.0.2.0 工件的第二个错误是我不太确定该怎么做。我搜索了一下,似乎我可能需要手动下载驱动程序并将其安装到我的本地存储库中。这是正确的吗?

我将 Nexus 与 Maven 一起使用。我需要如何将 ojdbc 驱动程序安装到 nexus 存储库中?

我从谷歌找到了这个页面 - http://www.zparacha.com/include-externaljar-file-in-maven/ 它讨论了如何将 jar 文件添加到 Maven。我不明白的是,当我运行该站点上描述的命令来安装 jar 文件时会发生什么? jar 文件会安装在我的本地仓库还是 nexus 仓库?

谢谢

【问题讨论】:

    标签: java maven jdbc build nexus


    【解决方案1】:

    首先:消息是警告,而不是错误。您的项目构建并运行良好,没有出现严重问题。

    插件及其版本可以在这里找到:http://maven.apache.org/plugins/index.html

    可以添加 Oracle JDBC 驱动程序,如下所示: https://repository.sonatype.org/index.html#nexus-search;quick~ojdbc

    如果使用该工件后错误仍然存​​在,则您无能为力 - 除了创建自己的存储库,但对于这些警告,不值得努力。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-10-24
      • 2013-03-15
      • 2020-01-09
      • 2019-09-30
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 2018-11-29
      相关资源
      最近更新 更多