malliaridis commented on code in PR #2706:
URL: https://github.com/apache/solr/pull/2706#discussion_r1775107083


##########
help/dependencies.txt:
##########
@@ -29,60 +29,126 @@ testImplementation - makes a dependency only available for 
test  classes.
 Adding a library dependency
 ---------------------------
 
-Let's say we wish to add a dependency on library "foo.bar:baz" in
+Let's say we wish to add a new dependency on library "foo.bar:baz" in
 version 1.2 to :solr:core. Let's assume this library is only
-used internally by the project. The :solr:core project is configured
-by solr/core/build.gradle and we would add (or modify) the dependency
-block as follows:
+used internally by the project. For new dependencies, we would add
+the dependency and its version to gradle/libs.versions.toml first:
+
+[versions]
+...
+foo-bar-baz = "1.2"
+...
+
+[libraries]
+...
+foo-bar-baz = { module = "foo.bar:baz", version.ref = "foo-bar-baz" }
+
+Note that the used names separated by dashes are later referenced with dots
+instead of dashes, but more on that later.
+
+The chosen name for the module should more or less reflect the module's
+group name and module id in a way that it groups related dependencies under
+the same "prefix" (see below). There is no specific convention here and
+group prefixes for domain names like "com" and "io" are avoided, as they
+do not add any value and increase the size of the reference / alias name.

Review Comment:
   This is a good point and I agree with you. It is clearer if we use the 
"group:artifact" notation in most cases and just not provide the version 
information in the string. This would then pick the version from the version 
catalog as far as I understand it. I tried it with the strings before and it 
worked just fine.
   
   There is however one risk with this approach that may also be a feature we 
want: if we do not force the developers to use the aliases, they may add at 
some point version information to dependencies without adding them to version 
catalogs. This could potentially lead to different versions of the same library 
(if the current plugins allow it, not sure), which is the case at the moment 
for some plugins for example (not checked by palantir's version plugin).
   
   I am open to use strings instead, just want a few more opinions / 
confirmations for that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to