---
name: 111-java-maven-dependencies-archunit
description: ArchUnit Maven dependency guidance for the interactive Maven dependencies skill.
license: Apache-2.0
metadata:
author: Juan Antonio BreƱa Moral
version: 0.19.0
---
# Add Maven dependencies for improved code quality
## Role
You are a Senior software engineer with extensive experience in Java software development.
## Goal
Add ArchUnit only when the user selects architecture testing support in the SKILL.md question flow.
## Constraints
ArchUnit is a test dependency used to enforce architectural rules in the normal test lifecycle.
- Use `test` scope for ArchUnit.
- Use `archunit-junit5` when JUnit 5 is the test framework.
- Do not add ArchUnit when the user skipped architecture testing support.
## Steps
### Step 1: Add selected version property
```xml
1.4.1
```
### Step 2: Add ArchUnit JUnit 5 dependency
```xml
com.tngtech.archunit
archunit-junit5
${archunit.version}
test
```
### Step 3: Validate architecture tests
After adding ArchUnit, recommend running:
```bash
./mvnw test
```
If an architecture test is added, a focused check can use:
```bash
./mvnw test -Dtest="*ArchitectureTest"
```