Bato-Bair Tsyrenov
Bato-Bair Tsyrenov

Reputation: 1194

Why Artifactory Maven and Oracle fail to communicate?

I hope an answer will be a universal guide on how to connect Maven, Oracle And Artifactory and will become most usefull webpage on the net. Most likely this question will be marked down, but I just give up on Maven, Artifactory and Oracle.

I am running windows 7-64 with maven installed as a part of Oracle jdev. Company has Artifactory setted up and running on vpn network.... but somethings are not right.

Following simple instructions on: http://biemond.blogspot.co.uk/2013/07/maven-support-in-weblogic-jdeveloper.html

fails at first instruction:

the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file are missing or invalid -> [Help 1]

adding

-Durl=file://C:\Users\{user}\.m2

seems to install that artifact to my local .m2 repo

C:\Users\{user}\.m2\com\oracle\maven\oracle-maven-sync\12.1.2-0-0

but only seems, then I get to number 3 on that tutorial:

gives an error:

[ERROR] Error resolving version for plugin 'com.oracle.maven:oracle-maven-sync' from the repositories [local (C:\Users\{user}\.m2), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]

So the plugin failed to install?

Oracle Maven repository is password protected due to weird oracle thoughts, Artifactory has external Central and Oracle repositories why letting it mirror everything stops maven from even finding deploy module?

here is my settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <servers>
    <server>
      <username>user</username>
      <password>xxx</password>
      <id>central</id>
    </server>
    <server>
      <username>user</username>
      <password>xxx</password>
      <id>snapshots</id>
    </server>
  </servers>

  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release-local</name>
          <url>http://art.host.ru:8081/artifactory/libs-release-local</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot-local</name>
          <url>http://art.host.ru:8081/artifactory/libs-snapshot-local</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>plugins-release-local</name>
          <url>http://art.host.ru:8081/artifactory/plugins-release-local</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>plugins-snapshot-local</name>
          <url>http://art.host.ru:8081/artifactory/plugins-snapshot-local</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
    <profile>
      <id>oracle-maven</id>
      <properties>
        <oracle-maven-sync.oracleHome>C:\Oracle\Middleware\Oracle_Home</oracle-maven-sync.oracleHome>
        <oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
        <oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
      </properties>      
    </profile>  

  </profiles>
  <activeProfiles>
    <activeProfile>oracle-maven</activeProfile>
  </activeProfiles>
</settings>

Upvotes: 0

Views: 1225

Answers (3)

Hani A.
Hani A.

Reputation: 11

The problem is with the -Dmaven.repo.local

Do not provide the argument.

Upvotes: 1

Bato-Bair Tsyrenov
Bato-Bair Tsyrenov

Reputation: 1194

Use http://jcenter.bintray.com for most of the artifacts

And for Oracle: oracle-maven-sync plugin oracle instructions

  • $ORACLE_HOME = where jdev 12.1.2
  • $M2_HOME = $ORACLE_HOME/oracle_common/modules/org.apache.maven_3.0.4
  • $M2 = $M2_HOME/bin (add to $PATH)
  • artifactory->home->maven settings generate settings.xml put it in ~/.m2
  • create local repo in artifactory"oracle-local-12.1.2"
  • settings.xml add following code

    <profiles>
    <profile>
      <properties>
        <oracle-maven-sync.oracleHome>$ORACLE_HOME</oracle-maven-sync.oracleHome>
        <oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
        <oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
        <oracle-maven-sync.serverId>oracle-local-12.1.2</oracle-maven-sync.serverId></properties>
    
  • artifactory -> username(top right corner) -> enter pass -> unlock -> забрать encrypted password(copy)

  • add aquired pass to settings.xml for all
  • go to $ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.2 (use cmd/terminal)
  • mvn deploy:deploy-file -DpomFile=oracle-maven-sync-12.1.2.pom -Dfile=oracle-maven-sync-12.1.2.jar
  • test it: mvn com.oracle.maven:oracle-maven-sync:help
  • push artifacts oracle 12.1.2 mvn com.oracle.maven:oracle-maven-sync:push
  • long time wait (~3000 artifacts > 2 hours)
  • complete set up of repos and in settings.xml

Upvotes: 0

JBaruch
JBaruch

Reputation: 22893

Well, I think you just follow the wrong guide. All this manual deployment of some random maven plugins is just wrong. Just follow the simple and detailed instructions in the Artifactory User Guide and you're good to go.

Upvotes: 1

Related Questions