microstream
microstream copied to clipboard
Clean up dependencies
Describe the bug
There are some declared and some undeclared dependencies in the project.
To Reproduce
run mvn org.apache.maven.plugins:maven-dependency-plugin:3.3.0:analyze
to get a list of dependency problems for each module.
Expected behavior
mvn org.apache.maven.plugins:maven-dependency-plugin:3.3.0:analyze
should output no problems.
@rfichtner Here I'm not sure if it is correct to list all versions in the dependency for transitive dependencies.
Example: for module:
[INFO] ------------< one.microstream:microstream-storage-embedded >------------
[INFO] Building MicroStream Embedded Storage 08.00.00-MS-GA-SNAPSHOT [14/57]
[INFO] --------------------------------[ jar ]---------------------------------
...
[INFO] --- maven-dependency-plugin:3.3.0:analyze (default-cli) @ microstream-storage-embedded ---
[WARNING] Used undeclared dependencies found:
[WARNING] one.microstream:microstream-afs-nio:jar:08.00.00-MS-GA-SNAPSHOT:compile
[WARNING] org.slf4j:slf4j-api:jar:1.7.32:compile
[WARNING] one.microstream:microstream-persistence:jar:08.00.00-MS-GA-SNAPSHOT:compile
[WARNING] one.microstream:microstream-persistence-binary:jar:08.00.00-MS-GA-SNAPSHOT:compile
[WARNING] one.microstream:microstream-base:jar:08.00.00-MS-GA-SNAPSHOT:compile
[WARNING] one.microstream:microstream-afs:jar:08.00.00-MS-GA-SNAPSHOT:compile
These are all modules that are transitive over a single ancestor. This project has a clear tree-like structure, has parent pom poms and the same versions.
Is it some good practice to add even transtive dependencies to the own product in pom.xml for each module? I haven't come across this in practice yet. Only in case of third libraries conflicts.
If your code imports from a module, that module is no longer only transitive. It should be a declared dependency in Maven, so that you communicate your intent to other developers, that directly depending on that module was no mistake, but intentional.