Skip to content

Latest commit

 

History

History
 
 

maven

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Maven Repo

Try this maven.yaml file to host a Maven repo:

repo:
  type: maven
  storage:
    type: fs
    path: /var/artipie/maven

Add <distributionManagement> section to your pom.xml (don't forget to specify authentication credentials in ~/.m2/settings.xml for artipie server):

<project>
  [...]
  <distributionManagement>
    <snapshotRepository>
      <id>artipie</id>
      <url>http://localhost:8080/maven</url>
    </snapshotRepository>
    <repository>
      <id>artipie</id>
      <url>http://localhost:8080/maven</url>
    </repository>
  </distributionManagement>
</project>

Then, mvn deploy your project.

Add <repository> and <pluginRepository> to your pom.xml (alternatively configure it via ~/.m2/settings.xml) to use deployed artifacts:

<project>
  [...]
  <pluginRepositories>
    <pluginRepository>
      <id>artipie</id>
      <name>artipie plugins</name>
      <url>http://localhost:8080/maven</url>
    </pluginRepository>
  </pluginRepositories>
  <repositories>
    <repository>
      <id>artipie</id>
      <name>artipie builds</name>
      <url>http://localhost:8080/maven</url>
    </repository>
  </repositories>
</project>

Run mvn install (or mvn install -U to force download dependencies).

Maven proxy Repo

Try this maven-proxy.yaml file to host a proxy to Maven central:

repo:
  type: maven-proxy
  remotes:
    - url: https://repo.maven.apache.org/maven2
      username: Aladdin # optional
      password: OpenSesame # optional

Artipie will redirect all requests to Maven central.

Proxy repository supports caching in local storage. To enable it and make previously accessed images available when source repository is down add storage section to config:

repo:
  type: maven-proxy
  remotes:
    - url: https://repo.maven.apache.org/maven2
      cache:
        storage:
          type: fs
          path: /tmp/artipie/data/my-maven-cache