2016-09-01 32 views
1

我不能与Maven导入jdbc7 Oracle驱动程序,我所做的一切都像在教程Oracle Blogs但我收到了如下错误:错误尝试导入甲骨文jdbc7司机与Maven

Could not resolve dependencies for project com.jp:database_connection_app:jar:0.0.1: Failed to collect dependencies at com.oracle.jdbc:ojdbc7:jar:12.1.0.2: Failed to read artifact descriptor for com.oracle.jdbc:ojdbc7:jar:12.1.0.2: Could not transfer artifact com.oracle.jdbc:ojdbc7: pom:12.1.0.2 from/to maven.oracle.com (https://maven.oracle.com): unexpected end of stream on Connection{maven.oracle.com:443, proxy=HTTP @ /myProxyIP:myPort hostAddress=hostAddressIP cipherSuite=none protocol=http/1.1} (recycle count=0): \n not found: size=0 content=... ->

一种特殊的情况,在我看来我在代理之后,但我已经配置了settings.xml文件,并且maven可以下载除JDBC之外的所有依赖项。

中提到的,我不明白哪些信息应被海尔教程...

<basicAuthScope> 
    <host>ANY </host> 
    <port>ANY </port> 
    <realm>OAM 11g </realm> 
</basicAuthScope> 

也许这是误差源。

这是我的settings.xml ...

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 
        https://maven.apache.org/xsd/settings-1.0.0.xsd"> 
<localRepository>${user.home}/.m2/repository</localRepository> 
<interactiveMode>true</interactiveMode> 
<usePluginRegistry>false</usePluginRegistry> 
<offline>false</offline> 
<pluginGroups/> 
<servers> 
    <server> 
     <id>maven.oracle.com</id> 
     <username>myUsername</username> 
     <password>My_Encripted_Password</password> 
     <configuration> 
     <basicAuthScope> 
      <host>ANY</host> 
      <port>ANY</port> 
      <realm>OAM 11g</realm> 
     </basicAuthScope> 
    <httpConfiguration> 
     <all> 
     <params> 
     <property> 
      <name>http.protocol.allow-circular-redirects</name> 
      <value>%b,true</value> 
     </property> 
     </params> 
     </all> 
    </httpConfiguration> 
     </configuration> 
    </server> 
</servers> 
<mirrors> 
    <mirror> 
     <id>UK</id> 
     <name>UK Central</name> 
     <url>http://uk.maven.org/maven2</url> 
     <mirrorOf>central</mirrorOf> 
    </mirror> 
</mirrors> 
<proxies> 
    <proxy> 
     <id>default</id> 
     <active>true</active> 
     <protocol>http</protocol> 
     <host>myProxy</host> 
     <port>myPort</port> 
     <username>myUsername</username> 
     <password>myPassword</password> 
     <nonProxyHosts>*.google.com</nonProxyHosts> 
    </proxy> 
</proxies> 
<profiles/> 
<activeProfiles/> 
</settings> 

这里是我的POM ...

<dependencies> 
     <dependency> 
      <groupId>com.oracle.jdbc</groupId> 
      <artifactId>ojdbc7</artifactId> 
      <version>12.1.0.2</version> 
     </dependency> 
     <dependency> 
      <groupId>com.oracle.jdbc</groupId> 
      <artifactId>ucp</artifactId> 
      <version>12.1.0.2</version> 
     </dependency> 
    </dependencies> 

    <repositories> 
     <repository> 
      <id>maven.oracle.com</id> 
      <name>oracle-maven-repo</name> 
      <url>https://maven.oracle.com</url> 
      <layout>default</layout> 
      <releases> 
       <enabled>true</enabled> 
       <updatePolicy>always</updatePolicy> 
      </releases> 
     </repository> 
    </repositories> 

    <pluginRepositories> 
     <pluginRepository> 
      <id>maven.oracle.com</id> 
      <name>oracle-maven-repo</name> 
      <url>https://maven.oracle.com</url> 
      <layout>default</layout> 
      <releases> 
       <enabled>true</enabled> 
       <updatePolicy>always</updatePolicy> 
      </releases> 
     </pluginRepository> 
    </pluginRepositories> 

的设置-security.xml文件中的设置相同的路径下创建。 xml

感谢您的帮助。

+0

尽量不要在你的setting.xml中使用里面的所有东西 –

+0

pom.xml? server.xml中? [如何创建一个最小,完整和可验证的示例](http://stackoverflow.com/help/mcve) –

+0

不好意思。我已经使用settings.xml和pom编辑了这个问题 – Jesus

回答

2

我无法导入库像我想的话,我不得不寻找另一种解决方案:

  1. Oracle Web Site
  2. 包括罐到Maven本地存储库下载JAR。从Mkyong Web Site
  3. 更新双龙学会了依赖

如果有人有另一个想法,我会很高兴地知道这一点。