Code Monkey home page Code Monkey logo

trellis's Introduction

trellis

Trellis is a Maven plugin that helps manage and prevent dependency entanglement in large projects.

It allows you to enforce simple, high-level rules that constrain how modules are allowed to depend on one another. Code changes that violate your rules will cause a build failure.

Features

  • wildcard matching on group/artifact ids
  • composable group definitions
  • automatic whitelisting

Examples

Rules are declared in simple yaml files that live in the root of your maven project. Here some examples of the kinds of rules you can declare:

Ensure that only a specific module is allowed to depend on my 'secret-api' module:

rules:
- action: ALLOW
  from: my:chosen-module
  to: my:secret-api

- action: DENY
  from: my:*
  to: my:secret-api

Enforce a naming convention in which 'api' modules are not allowed to depend on 'impl' modules:

groups:
- name: API_MODULES
  includes:
  - *:*-api

- name: IMPL_MODULES
  includes:
  - *:*-impl

rules:
- action: DENY
  from: [API_MODULES]
  to: [IMPL_MODULES]
  reason: apis shouldn't depend on impls.

Ensure that your production code doesn't rely on testing frameworks:

groups:
- name: PRODUCTION_CODE
  includes:
  - my.app:*

- name: TEST_FRAMEWORKS
  includes:
  - junit:*

rules:
- action: DENY
  from: [PRODUCTION_CODE]
  exceptFrom: [my.app:special-case]
  to: [TEST_FRAMEWORKS]
  reason: prod code should be using test frameworks
  

Usage

Detailed usage documentation is available in here.

trellis's People

Contributors

pcal43 avatar svc-scm avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.