Skip to content
Novus Examples
gradle980 B

Gradle Settings Script with Version Catalog

A Gradle settings script — the file that actually defines a multi-project build — with pluginManagement, a repositories mode, a version catalog declaring libraries, a bundle and a plugin, and one project remapped to a custom directory.

Preview — first 35 linesgradle
// Gradle settings script: the file that defines what a multi-project build actually contains.
// Parsing fixture only; every repository host is example.invalid.

pluginManagement {
    repositories {
        maven { url = uri('https://maven.example.invalid/plugins') }
    }
}

dependencyResolutionManagement {
    repositoriesMode = RepositoriesMode.PREFER_SETTINGS

    repositories {
        maven { url = uri('https://maven.example.invalid/releases') }
    }

    versionCatalogs {
        libs {
            version('core', '3.2.1')
            library('core', 'com.example.lib', 'core').versionRef('core')
            library('http', 'com.example.lib:http:1.8.0')
            bundle('base', ['core', 'http'])
            plugin('conventions', 'com.example.internal.conventions').version('2.3.0')
        }
    }
}

rootProject.name = 'orders'

include 'orders-api'
include 'orders-worker'
include 'orders-shared'

project(':orders-shared').projectDir = file('libs/shared')

Specifications

Included Projects
3
Has Version Catalog
true
Catalog Libraries
2
Catalog Bundles
1
Catalog Plugins
1
Custom Project Dir
1

Testing contract

Expected to pass
Scenario
Determine a multi-project Gradle build's module list and version catalog from settings alone
Expected result
Three included projects resolve, orders-shared maps to libs/shared rather than its default path, and the catalog reports two libraries in one bundle

What is a .gradle file?

A .gradle file is a Gradle build script written in the Groovy DSL. It configures a project through blocks such as plugins, repositories, dependencies, and tasks, where each block is really a Groovy closure evaluated against a delegate object — which is why a build script is executable code rather than static configuration. The Kotlin DSL equivalent uses the .gradle.kts extension.

How to use this file

Use an example .gradle file to test build-script parsers, dependency extractors, and SBOM generators, verifying that dependency coordinates are read from each configuration, that plugin declarations are found, and that dynamic version ranges are surfaced rather than resolved.

How to use this file for testing

“Gradle Settings Script with Version Catalog” is a deterministic Novus Examples fixture for Config parsing, Syntax highlighting, Editor testing. TOML and INI configuration files with nested sections and typed values — for testing config parsers and loaders.

Documented properties for this file: GRADLE · 980 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.

Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.

Generated by generation/pipelines.py. Free for any use, no attribution required — license.