Conversation
Prepares a multi-module build for DBCP-589. Renames only, no content changes, so that history and blame follow the moved files.
- Turn the root into the commons-dbcp2-parent aggregator; commons-dbcp2 keeps its coordinates and binary compatibility - Add commons-dbcp2-jakarta, generated at build time from org.apache.commons.dbcp2.managed into org.apache.commons.dbcp2.managed.jakarta on jakarta.transaction-api 2.0.1 - Add commons-dbcp2-distribution for the bin and src archives - Make java.transaction a static requirement of the commons-dbcp2 module - Update the site and changes.xml, bump the version to 2.15.0-SNAPSHOT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements DBCP-589 along the direction discussed in #492: a multi-module 2.x build with a new
commons-dbcp2-jakartaartifact, whilecommons-dbcp2stays binary compatible.It supersedes #492, which migrated the existing
managedpackage fromjavax.transactiontojakarta.transactionin place and therefore broke binary compatibility (japicmp). Here the javax flavour stays as it is and the jakarta flavour is generated from it at build time.Layout
No duplicated sources
commons-dbcp2-jakartahas no Java sources in git. Ingenerate-sources/generate-test-sourcesan antrun step copiesorg.apache.commons.dbcp2.managed(and themanaged/transactiontests) fromcommons-dbcp2and rewrites them:javax.transaction.*becomesjakarta.transaction.*, exceptjavax.transaction.xa, which is part of the JDK.org.apache.commons.dbcp2.managedbecomesorg.apache.commons.dbcp2.managed.jakarta, and the test helper packageorg.apache.commons.dbcp2.transactionbecomesorg.apache.commons.dbcp2.transaction.jakarta.@sincevalues older than 2.15.0 become 2.15.0. Newer values are kept, so later additions tomanagedget the right version in both flavours.The generated sources go through the normal compile, test, javadoc, sources-jar, SpotBugs, PMD, moditect and OSGi steps. Checkstyle is skipped in that module because the originals are already checked in
commons-dbcp2. A fix inmanagedapplies to both flavours automatically.Details
src/main,src/testandsrc/confare incommons-dbcp2/via pure renames in a separate commit, sogit log --followand blame keep working.src/site,src/changesandsrc/mediastay at the root.commons-dbcp2module descriptor now hasrequires static java.transaction. The JTA API is only needed by the managed package, andcommons-dbcp2-jakartausers on the module path don't need the javax API.commons-dbcp2-jakartaexcludesjakarta.transaction-api1.3.3 (the javax packages) fromcommons-dbcp2and depends onjakarta.transaction-api2.0.1. Runtime dependencies arecommons-dbcp2,commons-pool2,commons-loggingandjakarta.transaction-api2.0.1.cdi-apiandinterceptor-apiareprovided, only for jdeps. Test dependencies use the jakarta flavours of Narayana and Geronimo, with the versions kept Java 8 compatible.commons-dbcp2-distributionbuilds the bin archive (both jars plus javadoc) and the src archive (the whole multi-module tree) in thereleaseprofile. The root and the code modules skip the assembly./commons-dbcp2/apidocs/,/commons-dbcp2-jakarta/apidocs/). The menu, index and building pages are updated, and the index documents the new Maven coordinates. The old/apidocs/URL could be kept when publishing viaignorePathsToDeleteif you prefer.commons.bc.versionstays 2.14.0.changes.xmlhas an entry for DBCP-589, and.gitignorenow ignores the NarayanaObjectStore/directories in the modules too.Verification
mvn) passes on Java 8, 11, 17, 21 and 25: 1605 tests incommons-dbcp2, 275 generated tests incommons-dbcp2-jakarta.japicmpagainst 2.14.0 is green.mvn -Prelease -Dgpg.skip -Dcommons.release.isDistModule=false verifybuilds the bin and src archives.mvn package site site:stagegenerates the site.commons-dbcp2-jakartaonjakarta.transaction2.0.1.AI disclosure: Claude Code (Anthropic) was used to restructure the build, write the POM and assembly changes, and run the verification builds. I reviewed all changes.