Polylith
Search…
Project
Projects configure Polylith's deployable artifacts.
A project is the result of combining one base with multiple components and libraries.
This project has one library (grey), two components (green) and one base (blue).
The artifacts that are built based on the projects are the end goal of the Polylith architecture, which we deploy in our test, staging and production environments.
Each project lives in a separate directory under the projects directory, where it has a configuration file:
1
▾ workspace
2
▾ projects
3
▾ myproject
4
deps.edn
Copied!
The configuration file lists all included bricks and project level libraries (brick level libraries are implicitly included):
1
{:deps {poly/change {:local/root "../../components/change"}
2
poly/creator {:local/root "../../components/creator"}
3
poly/file {:local/root "../../components/file"}
4
poly/git {:local/root "../../components/git"}
5
poly/help {:local/root "../../components/help"}
6
poly/lib {:local/root "../../components/lib"}
7
poly/migrator {:local/root "../../components/migrator"}
8
poly/shell {:local/root "../../components/shell"}
9
poly/util {:local/root "../../components/util"}
10
poly/validator {:local/root "../../components/validator"}
11
poly/version {:local/root "../../components/version"}
12
poly/ws-file {:local/root "../../components/ws-file"}
13
poly/poly-cli {:local/root "../../bases/poly-cli"}
14
15
org.clojure/clojure {:mvn/version "1.10.3"}
16
org.slf4j/slf4j-nop {:mvn/version "1.7.32"}}}
Copied!
Example projects can be found in the RealWorld example app and in the Polylith Tool.
Some languages, like Clojure, support having more than one src directory out of the box, or support including "projects" as in the example above, while other languages may need a plugin, like the build-helper-maven-plugin.
It's almost like magic, because all we have to do is to list all our building blocks used in e.g. a service, and everything will automatically "connect" without the need of dependency injection, annotations or any other "magic"!
This is also why the Polylith architecture can be used without tooling support and still give us most of its benefits.
Last modified 22d ago
Copy link