Skip to content
Snippets Groups Projects
Unverified Commit 9ec48045 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

feat(bazel): Use Gradle versioning for `maven_install` by default (#20748)

parent 14019fed
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ Renovate supports upgrading dependencies in Bazel `WORKSPACE` files.
1. Bazel support is enabled automatically
2. Renovate will search repositories for any `WORKSPACE` files in the repository
3. Existing dependencies will be extracted from `git_repository` and `http_archive` declarations
3. Existing dependencies will be extracted from `container_pull`, `git_repository`, `go_repository`, `maven_install`, and `http_archive`/`http_file` declarations
4. Renovate will replace any old versions with the latest version available
## git_repository
......@@ -54,6 +54,23 @@ http_archive(
Renovate uses the list of **releases** that it finds at the `url` to detect a new version.
## maven_install
By default, Maven dependencies are extracted in the context of Gradle versioning scheme.
To change it, configure `packageRules` like this:
```json
{
"packageRules": [
{
"matchManagers": ["bazel"],
"matchDatasources": ["maven"],
"versioning": "maven"
}
]
}
```
## Future work
Contributions and/or feature requests are welcome to support more patterns or additional use cases.
......@@ -378,6 +378,7 @@ describe('modules/manager/bazel/rules/index', () => {
{
currentValue: '1.1.1',
datasource: 'maven',
versioning: 'gradle',
depType: 'maven_install',
depName: 'com.example1:foo',
registryUrls: [
......@@ -388,6 +389,7 @@ describe('modules/manager/bazel/rules/index', () => {
{
currentValue: '2.2.2',
datasource: 'maven',
versioning: 'gradle',
depType: 'maven_install',
depName: 'com.example2:bar',
registryUrls: [
......@@ -398,6 +400,7 @@ describe('modules/manager/bazel/rules/index', () => {
{
currentValue: '3.3.3',
datasource: 'maven',
versioning: 'gradle',
depType: 'maven_install',
depName: 'com.example3:baz',
registryUrls: [
......
import is from '@sindresorhus/is';
import { z } from 'zod';
import { MavenDatasource } from '../../../datasource/maven';
import { id as versioning } from '../../../versioning/gradle';
import type { PackageDependency } from '../../types';
export const mavenRules = ['maven_install'] as const;
......@@ -52,6 +53,7 @@ export const MavenTarget = z
}): PackageDependency[] =>
artifacts.map(({ group, artifact, version: currentValue }) => ({
datasource: MavenDatasource.id,
versioning,
depName: `${group}:${artifact}`,
currentValue,
depType,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment