1. <i id='QpQlE'><tr id='QpQlE'><dt id='QpQlE'><q id='QpQlE'><span id='QpQlE'><b id='QpQlE'><form id='QpQlE'><ins id='QpQlE'></ins><ul id='QpQlE'></ul><sub id='QpQlE'></sub></form><legend id='QpQlE'></legend><bdo id='QpQlE'><pre id='QpQlE'><center id='QpQlE'></center></pre></bdo></b><th id='QpQlE'></th></span></q></dt></tr></i><div id='QpQlE'><tfoot id='QpQlE'></tfoot><dl id='QpQlE'><fieldset id='QpQlE'></fieldset></dl></div>
          <bdo id='QpQlE'></bdo><ul id='QpQlE'></ul>
        <tfoot id='QpQlE'></tfoot>
        <legend id='QpQlE'><style id='QpQlE'><dir id='QpQlE'><q id='QpQlE'></q></dir></style></legend>

        <small id='QpQlE'></small><noframes id='QpQlE'>

      2. Oracle JDBC ojdbc6 Jar 作为 Maven 依赖项

        时间:2023-09-20

          <small id='lMHzh'></small><noframes id='lMHzh'>

            <tbody id='lMHzh'></tbody>
          <tfoot id='lMHzh'></tfoot>
          1. <i id='lMHzh'><tr id='lMHzh'><dt id='lMHzh'><q id='lMHzh'><span id='lMHzh'><b id='lMHzh'><form id='lMHzh'><ins id='lMHzh'></ins><ul id='lMHzh'></ul><sub id='lMHzh'></sub></form><legend id='lMHzh'></legend><bdo id='lMHzh'><pre id='lMHzh'><center id='lMHzh'></center></pre></bdo></b><th id='lMHzh'></th></span></q></dt></tr></i><div id='lMHzh'><tfoot id='lMHzh'></tfoot><dl id='lMHzh'><fieldset id='lMHzh'></fieldset></dl></div>
              • <legend id='lMHzh'><style id='lMHzh'><dir id='lMHzh'><q id='lMHzh'></q></dir></style></legend>
                  <bdo id='lMHzh'></bdo><ul id='lMHzh'></ul>

                  本文介绍了Oracle JDBC ojdbc6 Jar 作为 Maven 依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我似乎无法让 Maven 将 ojdbc6.jar 文件捆绑到我项目的 war 文件中.当直接为 Hibernate 工具指定依赖项时,我让它在 POM 文件中工作.但它不会与项目的 war 文件捆绑在一起,因此我的项目不会在 Tomcat 上运行.

                  I cannot seem to get Maven to bundle the ojdbc6.jar file into my project's war file. I have it working within the POM file when specifying a dependency directly for Hibernate tools. But it won't get bundled with the project's war file, and therefore my project won't run on Tomcat.

                  我已经尝试了我可以在网上找到的所有解决方案,包括针对此问题指定的解决方案:

                  I have tried every solution I can find out there on the net, including those specified for this question here:

                  在Maven仓库中查找Oracle JDBC驱动

                  最近,我做了以下事情:

                  Most recently, I did the following:

                  1. 将jar文件下载到我的机器上

                  1. Download the jar file to my machine

                  运行以下命令将 jar 安装到我的本地存储库中:

                  Run the following command to install the jar into my local repository:

                  mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true
                  

                  (我也尝试过该命令的各种变体.)

                  (I've tried all kinds of variants of that command, too.)

                  最后,我将依赖项放入我的 pom 文件中:

                  Finally, I put the dependency into my pom file:

                  <dependency>
                      <groupId>com.oracle</groupId>
                      <artifactId>ojdbc6</artifactId>
                      <version>11.2.0.3</version>
                  </dependency>
                  

                • 我运行了一个干净的构建,但它失败了:

                • I run a clean build, but it fails:

                  mvn -U clean package
                  
                  [INFO] Scanning for projects...
                  [INFO]                                                                         
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Building jazztwo 0.0.1
                  [INFO] ------------------------------------------------------------------------
                  Downloading: http://repo1.maven.org/maven2/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar
                  [INFO] ------------------------------------------------------------------------
                  [INFO] BUILD FAILURE
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Total time: 0.700s
                  [INFO] Finished at: Tue Mar 27 15:06:14 PDT 2012
                  [INFO] Final Memory: 3M/81M
                  [INFO] ------------------------------------------------------------------------
                  [ERROR] Failed to execute goal on project jazztwo: Could not resolve dependencies for project edu.berkeley:jazztwo:war:0.0.1: Could not find artifact com.oracle:ojdbc6:jar:11.2.0.3 in central (http://repo1.maven.org/maven2) -> [Help 1]
                  

                • 为什么这不起作用?我准备把昂贵的电脑零件扔到房间里.这浪费了太多时间.(谢谢你,甲骨文.我们又付给你多少钱?)

                  Why doesn't this work? I'm ready to throw expensive computer parts across the room. This has wasted so much time. (Thank you, Oracle. How much did we pay you again?)

                  也许是因为我使用的是 Mac?

                  Is it because I'm on a Mac, perhaps?

                  推荐答案

                  正确答案由 Raghuram 在我的原始问题的评论部分提供.

                  The correct answer was supplied by Raghuram in the comments section to my original question.

                  无论出于何种原因,将mvn install"指向物理 ojdbc6.jar 文件的完整路径对我来说都不起作用.(或者我在运行命令时一直反复把它搞砸,但没有发出错误.)

                  For whatever reason, pointing "mvn install" to a full path of the physical ojdbc6.jar file didn't work for me. (Or I consistently repeatedly flubbed it up when running the command, but no errors were issued.)

                  cd 进入我保存 ojdb6.jar 的目录并从那里运行命令第一次工作.

                  cd-ing into the directory where I keep ojdb6.jar and running the command from there worked the first time.

                  如果拉古拉姆想回答这个问题,我会接受他的回答.谢谢大家!

                  If Raghuram would like to answer this question, I'll accept his answer instead. Thanks everyone!

                  这篇关于Oracle JDBC ojdbc6 Jar 作为 Maven 依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:休眠oracle序列产生大间隙 下一篇:如何在不创建存储过程的情况下在 Oracle 中将多行连接为一个?

                  相关文章

                  <tfoot id='L45SL'></tfoot>

                    <small id='L45SL'></small><noframes id='L45SL'>

                    <legend id='L45SL'><style id='L45SL'><dir id='L45SL'><q id='L45SL'></q></dir></style></legend>

                    1. <i id='L45SL'><tr id='L45SL'><dt id='L45SL'><q id='L45SL'><span id='L45SL'><b id='L45SL'><form id='L45SL'><ins id='L45SL'></ins><ul id='L45SL'></ul><sub id='L45SL'></sub></form><legend id='L45SL'></legend><bdo id='L45SL'><pre id='L45SL'><center id='L45SL'></center></pre></bdo></b><th id='L45SL'></th></span></q></dt></tr></i><div id='L45SL'><tfoot id='L45SL'></tfoot><dl id='L45SL'><fieldset id='L45SL'></fieldset></dl></div>
                      • <bdo id='L45SL'></bdo><ul id='L45SL'></ul>