Skip to content
Alena edited this page Mar 31, 2023 · 2 revisions

Maven

To host a Maven repository for Java artifacts and dependencies try the following configuration:

repo:
  type: maven
  storage:
    type: fs
    path: /tmp/artipie/data

To use this repository as regular maven repository in Java project, add the following configuration into pom project file (alternatively configure it via ~/.m2/settings.xml):

<repositories>
    <repository>
        <id>{artipie-server-id}</id>
        <url>http://{host}:{port}/{repository-name}</url>
    </repository>
</repositories>

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

To deploy the project into Artipie repository, add <distributionManagement> section to pom.xml project file (don't forget to specify authentication credentials in ~/.m2/settings.xml for artipie server):

<project>
  [...]
  <distributionManagement>
    <snapshotRepository>
      <id>artipie</id>
      <url>http://{host}:{port}/{repository-name}</url>
    </snapshotRepository>
    <repository>
      <id>artipie</id>
      <url>http://{host}:{port}/{repository-name}</url>
    </repository>
  </distributionManagement>
</project>

In the examples above {host} and {port} are Artipie service host and port, {repository-name} is the name of maven repository.