Packagist + Maven

Setting up accelerated dependency downloads for Maven

To use Packagist with Maven, you'll need to create or update your global settings.xml file, which is stored in your Maven user root (~/.m2/).

The best way to use Packagist with Maven involves setting up Packagist as a mirror. In this case it is considered by Maven to be equivalent to fetching from Maven Central.

Packagist doesn't need any authorization. It's a public endpoint. Here's an example setup:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- ... -->
  <mirrors>
    <mirror>
      <id>pkgst</id>
      <name>Packagist for Maven</name>
      <url>https://maven.pkg.st/</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>
  <!-- ... -->
 </settings>

After setting this, Maven will download from Packagist by default.

Other repositories

Need the main Google repository, or the Gradle plugin portal? We support ancillary Maven repositories and will soon offer an ability to configure repositories of your own.