Fork me on GitHub

Project Layout

Maven Central

Introduction

Project Layout is a small utility library for describing and working with conventional project directory layouts (sources, resources, tests, docs, etc.) in a consistent way. It is intended for build tooling and plugins that need to locate well-known folders reliably across different projects.

By centralizing these conventions in one place, tools and plugins can avoid hard-coded paths, reduce duplicated logic, and behave consistently across projects.

Overview

The library provides a simple model for a project layout (for example, src/main/java, src/test/resources, src/site) and utilities to resolve these paths relative to a project base directory. Using a single, centralized definition of the layout reduces duplicated path logic, makes tooling more predictable, and improves maintainability.

Key Features

  • Standardized representation of common Maven-style project folders
  • Resolve layout paths relative to a given project directory
  • Designed to be embedded in other tools/plugins that need consistent path conventions

Getting Started

Prerequisites

  • Java 8+
  • Maven 3.x

Basic Usage

Add the dependency:

<dependency>
  <groupId>org.machanism.machai</groupId>
  <artifactId>project-layout</artifactId>
  <version>0.0.11-SNAPSHOT</version>
</dependency>

Typical Workflow

  1. Use the default Maven-style layout or configure your own conventions.
  2. Resolve the directories you need (main sources, test sources, resources, docs) against the project base directory.
  3. Use the resolved paths in your build/tooling logic (scanners, generators, compilers, packagers).

Resources