Riduidel / aadarchi

A maven archetype to generate easily projects allowing architecture description using a mix of C4, agile architecture, Asciidoc and PlantUML
https://riduidel.github.io/aadarchi/
Apache License 2.0
40 stars 12 forks source link

Replace "maven:dependency" relationship description with something more meaningful #338

Closed Riduidel closed 1 year ago

Riduidel commented 1 year ago

Currently, dependencies detected through maven build all have the maven:dependency relationship description. This is a good default value, but couldn't we do better ?

We could read the maven pom using a standard XML parser and detect comments "near" the dependencies, or tags of a given namespace, but this would be quite hard for dependencies coming from BOM or other maven corner cases.

We could also add an additionnal file (something like src/architecture/resources/relationships-descriptions.???) where each key would be a dependency canonical path (groupId:artifactId) and each value would be a description.

The second solution has the advantage of allowing each module to easily define why a dependency is used and the additionnal advantage to easily be usable for other dependency systems (think about NPM, Python pip, and so on : as long as we can build a "path" out of a dependency, we can add that dependency to that file and it will appear in documentation).

Riduidel commented 1 year ago

Decision we wil use the additionnal file mechanism:

A new file can be added named src/architecture/resources/relationships-descriptions.properties

In this file, each key is a relationship name (from->to) and value is the description

Riduidel commented 1 year ago

Code should have three parts

  1. Detect when relationships are added
  2. Load the relationship description file
  3. Change the relationship description according to what is read in that file