Skip to content
Snippets Groups Projects
Unverified Commit ac5ec2b7 authored by Adam Setch's avatar Adam Setch Committed by GitHub
Browse files

feat(java): add workaround to limit releases to java LTS versions (#18007)

parent d6358f88
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,20 @@ description: Java versions support in Renovate ...@@ -8,6 +8,20 @@ description: Java versions support in Renovate
Renovate can update Gradle and Maven dependencies. Renovate can update Gradle and Maven dependencies.
This includes libraries and plugins as well as the Gradle Wrapper. This includes libraries and plugins as well as the Gradle Wrapper.
## LTS releases
The `config:base` preset includes the `workarounds:javaLTSVersions` preset.
The workaround limits Renovate to upgrade to LTS versions of the Java runtime only.
If you want Renovate to offer all `major` Java updates then add `workarounds:javaLTSVersions` to the `ignorePreset` array:
```
{
"extends": ["config:base"],
"ignorePresets": ["workarounds:javaLTSVersions"]
}
```
## Gradle ## Gradle
Renovate detects versions that are specified in a string `'group:artifact:version'` and those specified in a map `(group:groupName, name:ArtifactName, version:Version)`. Renovate detects versions that are specified in a string `'group:artifact:version'` and those specified in a map `(group:groupName, name:ArtifactName, version:Version)`.
......
...@@ -14,6 +14,7 @@ export const presets: Record<string, Preset> = { ...@@ -14,6 +14,7 @@ export const presets: Record<string, Preset> = {
'workarounds:reduceRepologyServerLoad', 'workarounds:reduceRepologyServerLoad',
'workarounds:doNotUpgradeFromAlpineStableToEdge', 'workarounds:doNotUpgradeFromAlpineStableToEdge',
'workarounds:supportRedHatImageVersion', 'workarounds:supportRedHatImageVersion',
'workarounds:javaLTSVersions',
], ],
ignoreDeps: [], ignoreDeps: [],
}, },
...@@ -118,4 +119,24 @@ export const presets: Record<string, Preset> = { ...@@ -118,4 +119,24 @@ export const presets: Record<string, Preset> = {
}, },
], ],
}, },
javaLTSVersions: {
description: 'Limit Java runtime versions to LTS releases',
packageRules: [
{
description:
'Limit Java runtime versions to LTS releases. To receive all major releases add `javaLTSVersions` to the `ignorePresets` array.',
matchDatasources: ['docker', 'adoptium-java'],
matchPackageNames: [
'eclipse-temurin',
'amazoncorretto',
'adoptopenjdk',
'openjdk',
'java',
],
versioning:
'regex:^(?<major>\\d+)?(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?([\\._+](?<build>\\d+))?(-(?<compatibility>.*))?$',
allowedVersions: '/^(?:8|11|17|21|25|29)(?:\\.|$)/',
},
],
},
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment