diff --git a/website/docs/java.md b/website/docs/java.md index 50bff064e751300472d9903ca1fbc51b76a911da..2828d228ebf46844707994047290d0ef21276b64 100644 --- a/website/docs/java.md +++ b/website/docs/java.md @@ -3,13 +3,15 @@ title: Java Versions description: Java versions support in Renovate --- -# Java Versions +# Java Dependency Updates -Renovate can update the version used in Gradle projects. This includes libraries and plugins. +Renovate can update the version used in Gradle and Maven projects. This includes libraries and plugins. -It detects versions specified as string `'group:artifact:version'` and as a map `(group:groupName, name:ArtifactName, version:Version)` +## Gradle -## File Support +Renovate detects versions specified as string `'group:artifact:version'` and as a map `(group:groupName, name:ArtifactName, version:Version)`. + +### File Support Renovate can update `build.gradle` files in the root of the repository and any `*.gradle` file inside any subdirectory as multi-project configurations. @@ -18,17 +20,45 @@ Renovate does not support: - Projects without a `build.gradle` file in the root of the repository. - Android projects that requires extra configuration to run. (e.g. setting the android SDK) -## How It Works +### How It Works + +Renovate uses a plugin to search and extract versions from projects. They are then looked up using Maven datasources and patched into PRs the usual way. + +It is recommended to use `gitFs` with Gradle, which is not the default setting for GitHub and GitLab. Enabling `gitFs` means that Renovate performs a shallow clone of the repository in order to get access to all the source files necessary, regardless of their name. + +## Maven + +Renovate can update dependency versions found in Maven `pom.xml` files. + +### File Support -Renovate uses [gradle-versions-plugin](https://github.com/ben-manes/gradle-versions-plugin) to generate a report with the dependencies that needs -to be updated. Then it goes through every gradle configuration file looking for every dependency and if it is found it -replaces the version. +Renovate will search repositories for all files named `pom.xml` and then process them independently. -It automatically configures [gradle-versions-plugin](https://github.com/ben-manes/gradle-versions-plugin) so you don't need to have it configured -as a dependency. +### Custom registry support, and authentication -## Future Work +Here is an example configuration to work with custom Artifactory servers using authentication: -Gradle support is currently being rewritten to be compatible with Renovate's other package managers, and no longer require the use of `gradle-versions-plugin`. With this will come Android support as well. +``` +{ + "maven": { + "enabled": true + }, + "hostRules": [{ + "platform": "maven", + "endpoint": "https://artifactoryurl1/", + "username": "artifactoryusername", + "password": "artifactorypassword" + }, { + "platform": "maven", + "endpoint": "https://artifactoryurl2/", + "username": "artifactoryusername", + "password": "artifactorypassword" + }], + "packageRules": [{ + "managers": ["maven"], + "registryUrls": ["https://artifactoryurl1/", "https://artifactoryurl2/"] + }] +} +``` -Maven support is also in development and anticipated to be ready soon. +In the above config, the custom registry URLs are defined using a package rule, and the username/passwords are set using a host rule each.