0

I'm developing Oracle custom authentication plugin(OAM 11g) using maven dependencies.I've followed all the steps listed in Oracle documentation to add maven dependencies:

1)Created account with OTN and accepted the licence 2)Created my setting file and POM file and added the following:

<server>
    <id>maven.oracle.com</id>
      <username>myemail@gmail.com</username>
        <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>

After following these steps, I still getthe error "The import oracle.security cannot be resolved" in my Java class, which means the dependencies and not resolved in my program. I would appreciate if anybody out there can help me understand this issue.Thanks

bencho
  • 23
  • 1
  • 9

2 Answers2

0

I don't think this issue is related to oracle security. Jars related to oracle are not usually published to maven central due to licensing restriction. You will need to

  1. Upload jars manually to your company nexus or artifactory.
  2. OR keep them along with your project and use system dependency mechanism.

Point 2 explained:

  1. Maintain a jar folder in your project and keep jar files there.
  2. In your dependency snippet in pom ,
<dependencies>
    <dependency>
      <groupId>oracle.security</groupId>
      <artifactId>oracle-api</artifactId>
      <version>2.0</version>
      <scope>system</scope>
      <systemPath>${project.basedir}/jars/oracle-api.jar</systemPath>
    </dependency>
 </dependencies>

Repeat above for other jars as well.

This will resolve your The import oracle.security cannot be resolved exception.

GauravJ
  • 2,162
  • 1
  • 22
  • 28
  • Hi @GauravJ can you please explain to me how to implement option number two you have mentioned above. Thanks for taking your time to help. – bencho Feb 08 '17 at 06:28
  • I have modified my answer – GauravJ Feb 08 '17 at 07:18
  • Hi @GauravJ, Thanks for taking your time to explain this step no.2. Let me try this new approach here and see if it helps. – bencho Feb 08 '17 at 14:24
0

You need add following repository definition to your pom.xml.

You get more Information here setting up multiple repositories

<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>
ravthiru
  • 8,878
  • 2
  • 43
  • 52
  • I have this already in pom file and settings.xml but I still get this error. Is there something else I need to ?..thanks – bencho Feb 08 '17 at 06:31