0
votes

I want use mvn clean install on Travis-CI but my ojdbc7 dependancy is not downloaded because my maven setting do not have the https://maven.oracle.com and login/password

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

In my local machine is OK because my local .m2 contain .m2\repository\com\oracle\jdbc\ojdbc7\12.1.0.2\ojdbc7-12.1.0.2.jar

2

2 Answers

1
votes

It would seem you would need to follow the instructions laid out in the following guide:

Fusion Middleware Developing Applications Using Continuous Integration : Chapter 6 - Configuring the Oracle Maven Repository

Specifically:

  1. Register: https://www.oracle.com/webapps/maven/register/license.html

  2. Add the Oracle Maven Repo to your POM:

<repositories>
  <repository>
    <id>maven.oracle.com</id>
    <releases>
      <enabled>true</enabled>
    </releases>
    <snapshots>
      <enabled>false</enabled>
    </snapshots>
    <url>https://maven.oracle.com</url>
    <layout>default</layout>
  </repository>
</repositories>
<pluginRepositories>
  <pluginRepository>
    <id>maven.oracle.com</id>
    <url>https://maven.oracle.com</url>
  </pluginRepository>
</pluginRepositories>
  1. Make sure your version of http-wagon is using 2.8 or above

  2. Then configure the repository OTN login in your Maven settings.xml

 <server>
    <id>maven.oracle.com</id>
    <username>**username**</username>
    <password>**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>
0
votes

Best answer for my question despite any downvote !!!

I create a sample on github with all explications: https://github.com/sgrillon14/MavenSampleOracleJdbc

Your pom.xml

<repositories>
    <repository>
        <id>maven.oracle.com</id>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <url>https://maven.oracle.com</url>
        <layout>default</layout>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>maven.oracle.com</id>
        <url>https://maven.oracle.com</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <dependency>
        <groupId>com.oracle.jdbc</groupId>
        <artifactId>ojdbc8</artifactId>
        <version>12.2.0.1</version>
    </dependency>
</dependencies>

settings.xml

<settings>
    <servers>
        <server>
            <id>maven.oracle.com</id>
            <username>${OTN_USERNAME}</username>
            <password>${OTN_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>
</settings>