build-and-test

Build and test Java multi-module Maven projects with selective module and test patterns.

208|21|Updated Jul 23, 2022
One-click install
npx skills add https://github.com/dtprj/dongting --skill build-and-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-and-test
Source: https://github.com/dtprj/dongting/tree/main/.opencode/skills/build-and-test
Command: npx skills add https://github.com/dtprj/dongting --skill build-and-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines building and testing a Java multi-module project using Maven, reducing manual setup and repetitive commands.

Core Features & Use Cases

  • Full builds across modules using Maven, with optional skip of unit tests.
  • Selective module builds and test-compile phases to speed up feedback.
  • Flexible test execution patterns for unit and integration tests, including ticking tests via -Dtick.

Quick Start

Run mvn clean package -DskipUTs to perform a full build, then mvn clean test -Dtick=5 to run unit tests, and mvn verify -DskipUTs -Dit.test=ClassName to run a specific integration test.

Frequently Asked Questions about build-and-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Java multi-module project and skip unit tests?

To build a Java multi-module project and skip unit tests, run mvn clean package -DskipUTs. This Maven command performs a full build across all modules while bypassing the unit test phase to speed up the process.

Can I run a specific integration test in a Maven multi-module project?

Yes, you can run a specific integration test by executing mvn verify -DskipUTs -Dit.test=ClassName. This Maven command targets a single integration test class while skipping unit tests.

How do I execute unit tests selectively in a Java Maven project?

You can execute unit tests selectively by running mvn clean test -Dtick=5. This Maven command runs unit tests using the ticking test pattern to control execution scope.

Do I need Maven to build and test Java enterprise codebases?

Yes, you need Maven and a Java toolchain to build and test Java enterprise codebases. This setup supports full builds, selective module builds, and various test execution patterns across modules.

What is the best way to speed up feedback during Java multi-module development?

The best way to speed up feedback is using selective module builds and test-compile phases. Running targeted Maven commands like mvn clean test -Dtick=5 limits execution scope, providing faster results.

Can I compile tests without running a full build in a Java multi-module project?

Yes, you can compile tests without a full build by using the selective test-compile phases. This Maven feature allows you to verify compilation across modules without executing the complete package lifecycle.