Keep your Root token out of source control. Use environment variable interpolation (${env.ROOT_TOKEN}) in settings.xml and export the token in your shell or CI environment.
# GitHub Actions example- name: Build with Maven run: mvn -U test env: ROOT_TOKEN: ${{ secrets.ROOT_TOKEN }}
Use environment variable interpolation in settings.xml to inject the token safely:
<password>${env.ROOT_TOKEN}</password>
Gradle
The Root.io Gradle Plugin automatically patches vulnerable dependencies at build time with zero changes to your dependency declarations.
Installation
Apply the plugin in build.gradle.kts:
plugins { id("io.root.patcher") version "0.2.0"}
The plugin is published to the Gradle Plugin Portal — no extra repository configuration needed. If your pluginManagement block explicitly lists repositories, make sure gradlePluginPortal() is included.If your organization uses JFrog Artifactory, you can also host the plugin there or route patched artifact resolution through an Artifactory proxy - see Private JFrog Artifactory in the Gradle integration guide.