michaelsembwever commented on code in PR #170: URL: https://github.com/apache/cassandra-website/pull/170#discussion_r963342004
########## site-content/source/modules/ROOT/pages/development/dependencies.adoc: ########## @@ -12,13 +12,44 @@ As Cassandra is an Apache product, all included libraries must follow Apache's https://www.apache.org/legal/resolved.html[software license requirements]. +=== Changes to dependency management in Cassandra 4.2 + +Before Cassandra 4.2, dependencies were managed in `build.xml` and managed with +Maven Ant Tasks. In Cassandra 4.2 and onwards, dependencies are managed in +Maven POM templates in `.build/*-template.xml`. These templates are processed +into valid Maven POMs with the `ant write-poms` task and copied to +`build/*.pom`. + +The following POMs from `build.xml` have been migrated to templates: +* `parent-pom` is now at `.build/parent-pom-template.xml` +* `all-pom` is now at `.build/cassandra-deps-template.xml` +* `build-deps-pom` is now at `.build/cassandra-build-deps-template.xml` + +To add new dependencies in Cassandra 4.2 onwards, add the dependency to +`parent-pom-template` and `cassandra-deps-template`, and optionally +`cassandra-build-deps-template` if the dependency is required for build only. +See +https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management[the +Maven docs] on how to reference dependencies in the parent POM from the child +POMs. + +For dependency versions that need to be available in `build.xml` and +`parent-pom-template`, specify the version as a property in `build.xml`, add it +to the `ant write-poms` target, then add the property to `parent-pom-template` +with the value of the template substitution. + +For more information on this change, see +https://issues.apache.org/jira/browse/CASSANDRA-17750[CASSANDRA-17750]. + Review Comment: > In my opinion, the main audience for this doc (in the short term) is developers who are familiar with how to add dependencies in the pre-4.2 world, and are trying to figure out how to do things post-17750. I would disagree with this statement :) because that method only existed for a year, ref [CASSANDRA-16391](https://issues.apache.org/jira/browse/CASSANDRA-16391). There was a much longer precedence before (checking jar and license files into `lib/`) I do suspect most developers are next to starting from scratch (and we don't add deps that often). If you want the extra explanation there, I don't object if it appears later. But I'm in the "don't explain, don't complain" camp, where a _tl;dr what do i do_ comes first so I can be quick. (My example was overly concise, and only meant as an example.) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

