vaticle / typedb-console

TypeDB Console: CLI for TypeDB and TypeDB Cluster
https://typedb.com
Mozilla Public License 2.0
7 stars 16 forks source link

Distribution JARs must be uniquely identified by their Maven coordinates #184

Open lolski opened 2 years ago

lolski commented 2 years ago

Some JARs in the distribution are not uniquely identified by Maven coordinates. It may cause one JAR to be overwritten by another, if they happen to have the same name.

Consider the following example: Suppose Console depends on @vaticle_typedb_client_java//common and @vaticle_typedb_common//common. When bazel build is invoked bazel-bin/external/vaticle_typedb_client_java/common/libcommon.jar and bazel-bin/external/vaticle_typedb_common/common/libcommon.jar will be generated, respectively. During the assembly process, both JARs will be placed within the lib directory and given that both JARs have identical names, one will overwrite the other.

Therefore, we must ensure that all JARs are uniquely identified by assigning Maven coordinates to each of them.

lolski commented 2 years ago

However, some Bazel targets are intentionally not given Maven coordinates if they are meant to be compiled upwards into a single top-level Bazel target as a single fat JAR.

Client Java, for instance, uses this fat JAR approach in order to make it easy for our users to include it as a dependency in their program, ie., they only need to declare one dependency instead of multiple in their pom.xml.

My proposal is to only depend on JARs that have Maven coordinates. In this case, Console should depend on Client Java's fat JAR produced by assemble_maven.