-1

I have a jira trying to download dependencies from the server. I have a repository that is configured and works great. This repository duplicates data from the server (in fact it is a secure gateway).

BUT somehow jira tries to connect directly to the server, at the same time it refers to the repository: 3 enter image description here

enter image description here I thought that in jira connection with the network and with the Internet is configured in maven. Maybe I'm wrong ?

here are the settings of the mavena setting.xml lying in (atlassian-plugin-sdk-6.2.14 \ apache-maven-3.2.1 \ conf)

<?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">
  <profiles>
    <profile>
      <repositories>
        <repository>
          <id>maven-public</id>
          <url>http://n7701-sys274:8081/artifactory/maven-public</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </repository>
        <repository>
         <id>maven-external</id>
          <url>http://n7701-sys274:8081/artifactory/maven-external</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </repository>
        <repository>
          <id>maven2</id>
          <url>http://n7701-sys274:8081/artifactory/maven2/</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </repository>
        <repository>
          <id>public</id>
          <url>http://n7701-sys274:8081/artifactory/public/</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>public</id>
          <url>http://n7701-sys274:8081/artifactory/public/</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </pluginRepository>
        <pluginRepository>
          <id>maven2</id>
          <url>http://n7701-sys274:8081/artifactory/maven2/</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </pluginRepository>
        <pluginRepository>
          <id>maven-external</id>
          <url>http://n7701-sys274:8081/artifactory/maven-external</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </pluginRepository>
        <pluginRepository>
          <id>maven-public</id>
          <url>http://n7701-sys274:8081/artifactory/maven-public</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings> 
timob256
  • 148
  • 2
  • 15

1 Answers1

0

Unless I am mistaken your problem is that:

  • you properly configure maven to retrieve artifacts from your artifactory server
  • maven downloads a batch of artifacts from artifactory and resolves them
  • maven then tries to download transitive dependencies from maven central

Maven central is a special pre-configured repository, injected through automatic POM inheritance. So your artifacts are resolved both in the repositories defined in your own settings.xml and in maven central

In a nutshell, you need to define in your settings.xml that your artifactory server acts as a mirror to maven central, with the following snippet

  ...
  <mirrors>
    <mirror>
      <id>central-proxy</id>
      <name>Artifactory proxy of central repo</name>
      <url>http://n7701-sys274:8081/artifactory/maven-public</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
  ...

Note that closely related to this question is Disable Maven central repository My answer is a combination of the solutions to this question.

Arnaud Jeansen
  • 1,619
  • 15
  • 27