> java-tooling
Standards for build tools (Maven/Gradle) and static analysis. Use when configuring Maven/Gradle builds or static analysis tools for Java projects. (triggers: pom.xml, build.gradle, build.gradle.kts, build, dependency, plugin, sdk, lint)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/java-tooling?format=md"Java Tooling Standards
Priority: P2 (RECOMMENDED)
Standardized build and tooling configuration for consistent environments.
Implementation Guidelines
- JDK Management: Use
.sdkmanrcor.java-versionto lock JDK versions (Target LTS: 17 or 21). - Maven: Use
pom.xmlwith<dependencyManagement>for version control. Use wrapper (mvnw). - Gradle: Prefer Kotlin DSL (
build.gradle.kts). Use version catalogs (libs.versions.toml). Use wrapper (gradlew). - Linter: Use Spotless or Checkstyle (Google Style) to enforce formatting.
- Static Analysis: Integrate SpotBugs or SonarLint for deeper issue detection.
- Docker: Use multi-stage builds. Use
eclipse-temurinordistrolessimages.
Anti-Patterns
- Global Installs: Relying on system Maven/Gradle. Always use wrappers.
- Fat Jars: Avoid massive uber-jars if possible; prefer layered Docker images for caching.
- Snapshot Dependencies: Do not rely on
-SNAPSHOTversions in production builds.
Code
// build.gradle.kts (Gradle Kotlin DSL)
plugins {
java
id("com.diffplug.spotless") version "6.23.3"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
spotless {
java {
googleJavaFormat()
}
}
Related Topics
language | best-practices | testing
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)