Use local artifactory in maven and gradle

Gradle

Add file ~/.gradle/init.d/artifactory.gradle with content:

allprojects {
  repositories {
    maven {
      name "local artifactory repository"
      url "http://ARTIFACTORY_ADDRESS:8081/artifactory/repo"
    }
  }
  buildscript {
    repositories {
      maven {
        name "local artifactory repository"
        url "http://ARTIFACTORY_ADDRESS:8081/artifactory/repo"
      }
    }
  }
}

Maven

Add file ~/.m2/settings.xml with content:

<settings>
  <mirrors>
    <mirror>
      <id>internal-repository</id>
      <name>local artifactory repository</name>
      <url>http://ARTIFACTORY_ADDRESS:8081/artifactory/repo</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
</settings>