diff --git a/lib/manager/gradle/shallow/extract.spec.ts b/lib/manager/gradle/shallow/extract.spec.ts
index 33678e57c896c9442ded18aefc4f847d78a9f952..951001c92c74ba609bf5f7584502648d23960ca4 100644
--- a/lib/manager/gradle/shallow/extract.spec.ts
+++ b/lib/manager/gradle/shallow/extract.spec.ts
@@ -1,5 +1,6 @@
 import { extractAllPackageFiles } from '..';
 import { fs, loadFixture } from '../../../../test/util';
+import { SkipReason } from '../../../types';
 import type { ExtractConfig } from '../../types';
 
 jest.mock('../../../util/fs');
@@ -108,6 +109,34 @@ describe('manager/gradle/shallow/extract', () => {
     ]);
   });
 
+  it('skips versions composed from multiple variables', async () => {
+    mockFs({
+      'build.gradle':
+        'foo = "1"; bar = "2"; baz = "3"; "foo:bar:$foo.$bar.$baz"',
+    });
+
+    const res = await extractAllPackageFiles({} as ExtractConfig, [
+      'build.gradle',
+    ]);
+
+    expect(res).toMatchObject([
+      {
+        packageFile: 'build.gradle',
+        deps: [
+          {
+            depName: 'foo:bar',
+            currentValue: '1.2.3',
+            registryUrls: ['https://repo.maven.apache.org/maven2'],
+            skipReason: SkipReason.ContainsVariable,
+            managerData: {
+              packageFile: 'build.gradle',
+            },
+          },
+        ],
+      },
+    ]);
+  });
+
   it('works with file-ext-var', async () => {
     mockFs({
       'gradle.properties': 'baz=1.2.3',
diff --git a/lib/manager/gradle/shallow/parser.ts b/lib/manager/gradle/shallow/parser.ts
index f684215c8e390740983260aa2b82d290e4626704..6c913197f089b42483417b1506d7d4080de857df 100644
--- a/lib/manager/gradle/shallow/parser.ts
+++ b/lib/manager/gradle/shallow/parser.ts
@@ -1,6 +1,7 @@
 import * as url from 'url';
 import is from '@sindresorhus/is';
 import { logger } from '../../../logger';
+import { SkipReason } from '../../../types';
 import { regEx } from '../../../util/regex';
 import type { PackageDependency } from '../../types';
 import type { GradleManagerData } from '../types';
@@ -147,20 +148,23 @@ function processDepInterpolation({
   if (interpolationResult && isDependencyString(interpolationResult)) {
     const dep = parseDependencyString(interpolationResult);
     if (dep) {
+      let packageFile: string;
+      let fileReplacePosition: number;
       token.children.forEach((child) => {
         const variable = variables[child.value];
-        if (
-          child?.type === TokenType.Variable &&
-          variable &&
-          variable?.value === dep.currentValue
-        ) {
-          dep.managerData = {
-            fileReplacePosition: variable.fileReplacePosition,
-            packageFile: variable.packageFile,
-          };
-          dep.groupName = variable.key;
+        if (child?.type === TokenType.Variable && variable) {
+          packageFile = variable.packageFile;
+          fileReplacePosition = variable.fileReplacePosition;
+          if (variable?.value === dep.currentValue) {
+            dep.managerData = { fileReplacePosition, packageFile };
+            dep.groupName = variable.key;
+          }
         }
       });
+      if (!dep.managerData) {
+        dep.managerData = { fileReplacePosition, packageFile };
+        dep.skipReason = SkipReason.ContainsVariable;
+      }
       return { deps: [dep] };
     }
   }