Skip to main content

Configure ~/.m2/settings.xml

<settings>
  <servers>
    <server>
      <id>root-io</id>
      <username>rootio</username>
      <password>${env.ROOT_TOKEN}</password>
    </server>
  </servers>

  <mirrors>
    <mirror>
      <id>root-io</id>
      <name>Root.io Mirror for All Maven Repositories</name>
      <url>https://pkg.root.io/maven/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>root-io</id>
      <repositories>
        <repository>
          <id>root-io</id>
          <name>Root.io Maven Patches</name>
          <url>https://pkg.root.io/maven/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>root-io</id>
          <name>Root.io Maven Plugins</name>
          <url>https://pkg.root.io/maven/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>root-io</activeProfile>
  </activeProfiles>
</settings>

Fetch a Dependency

export ROOT_TOKEN="your-token-here"
mvn dependency:get -Dartifact=com.example:your-artifact:1.2.3

Run Maven

export ROOT_TOKEN="your-token-here"
mvn -U test

CI/CD

# GitHub Actions example
- name: Build with Maven
  run: mvn -U test
  env:
    ROOT_TOKEN: ${{ secrets.ROOT_TOKEN }}

Troubleshooting

IssueSolution
401 UnauthorizedVerify ROOT_TOKEN is exported and settings.xml uses ${env.ROOT_TOKEN}
Could not resolve artifactConfirm mirrorOf is set to central
Checksum validation errorsExpected — Root-patched artifacts have different checksums than Maven Central
SNAPSHOT artifactsSet <snapshots><enabled>false</enabled></snapshots>