https://github.com/lajoscseppento/ruthless
Ruthless conventions for Gradle projects
https://github.com/lajoscseppento/ruthless
conventions defaults dry gradle java ruthless spring spring-boot standards
Last synced: 2 months ago
JSON representation
Ruthless conventions for Gradle projects
- Host: GitHub
- URL: https://github.com/lajoscseppento/ruthless
- Owner: LajosCseppento
- License: apache-2.0
- Created: 2020-11-22T21:35:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T20:16:14.000Z (over 2 years ago)
- Last Synced: 2025-07-20T16:02:04.581Z (11 months ago)
- Topics: conventions, defaults, dry, gradle, java, ruthless, spring, spring-boot, standards
- Language: Java
- Homepage:
- Size: 364 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Ruthless
[](https://github.com/LajosCseppento/ruthless/releases/latest)
[](https://plugins.gradle.org/plugin/dev.lajoscseppento.ruthless)
[](https://search.maven.org/search?q=g:%22dev.lajoscseppento.ruthless%22%20AND%20a:%22dev.lajoscseppento.ruthless.gradle.plugin%22)
[](https://github.com/LajosCseppento/ruthless/actions)
[](https://www.apache.org/licenses/LICENSE-2.0)
Ruthless conventions for Gradle projects to keep them DRY. Inspired by `buildSrc` conventions
generated by Gradle `init`. Selfishly tailored for my taste, sorry.
> If you are looking for a flexible way of sharing build logic between projects, without enforcing
> someone else's coding conventions and dependency versions, you might want to have a look at
> [Blowdryer](https://github.com/diffplug/blowdryer).
## Features
- `dev.lajoscseppento.ruthless` - multi-use plugin, can apply to init, settings or project
- 5 plugins, choose the best fit:
- `dev.lajoscseppento.ruthless.java-application` - Java application
- `dev.lajoscseppento.ruthless.java-gradle-plugin` - Java Gradle Plugin
- `dev.lajoscseppento.ruthless.java-library` - Java library
- `dev.lajoscseppento.ruthless.spring-boot-application` - Spring Boot application
- `dev.lajoscseppento.ruthless.spring-boot-library` - Spring Boot library
- Multi-project support
- Lombok by default (it can be disabled via `ruthless.lombok`)
- Default dependency versions for Guava, Lombok, Jackson, JUnit 5, Mockito, AssertJ... and more!
- `dev.lajoscseppento.ruthless.logging` - logging conventions are also available as a standalone plugin
For examples see `ruthless-demo` and `ruthless-logging-demo`. For details, see the source code.
## Usage
First, create `gradle.properties`:
```properties
group=com.example
version=0.1.0-SNAPSHOT
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configureondemand=true
```
Then, `settings.gradle.kts` to apply defaults. This will apply a base Ruthless plugin to all
subprojects (multi-project is not enforced, you can go with single-project if you like that
setup more):
```kotlin
plugins {
id("dev.lajoscseppento.ruthless") version "0.8.0"
}
rootProject.name = "my-project"
include(
"my-project-app",
"my-project-lib"
)
```
Then in `build.gradle.kts` for each project, you can specify the project type to apply basic
setup (not obligatory):
```kotlin
// For a Java library:
plugins {
id("dev.lajoscseppento.ruthless.java-library")
}
// For a Spring Boot application
plugins {
id("dev.lajoscseppento.ruthless.spring-boot-application")
}
```
See `ruthless-demo` for a complete example.
## Developing Ruthless
Ruthless is a standard Gradle plugin project.
For manual local testing, it is recommended to publish the plugin to the local Maven repository.
```shell script
./gradlew publishToMavenLocal
```
Then use the local snapshot in the demo project:
```shell script
# Full demo
cd ruthless-demo
../gradlew --init-script init-dev.gradle.kts ...
# Logging-only demo
cd ruthless-logging-demo
../gradlew --init-script init-dev.gradle.kts ...
```
### Release Procedure
1. Fix version, finalise change log
2. Publish to Maven Central
1. Run `./gradlew publishToSonatype closeSonatypeStagingRepository`
2. Open https://oss.sonatype.org/#stagingRepositories
3. Inspect contents
4. Release
3. Publish to Gradle Plugin Portal using `./gradlew publishPlugins`
4. Bump version
5. Upgrade to recently released version (`ruthless`, `ruthless-demo` and `ruthless-logging-demo`)