chore: Fix wrong Maven version numbers #170
Merged
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.
To make the #155 review easier, I'm "forking out" a change that I implicitly made there into a tiny separate PR here, which @shukladivyansh raised a question about (here), so that we can discuss and settle that matter here in isolation, first.
So the
<version>0.1.0which the existing x2 POMs on the currentmainbranch (as of cec9ef3) use is simply wrong. This isn't an "opinion" or a "preference", but simply due to how Maven works. The reason is the following, if I may try to explain:This project has already release a 0.1.0 version. That's awesome - great!! That is now, of course, a stabled fixed version, agreed? (BTW see the #169 issue, but that's kind of separate from what this is about.)
OK, so now I'm (someone is) using the ADK. For example, say with https://github.com/enola-dev/LearningADK/tree/main/quickstart. Or wherever. That uses ADK v0.1.0. Cool. So now you have
~/.m2/repository/com/google/adk/google-adk/0.1.0/google-adk-0.1.0.jar, right? Great.Then suppose you (someone; me, or anyone else, or even some tool) does a
git clone https://github.com/google/adk-java.git && cd adk-java && ./mvnw clean installit. Or perhaps e.g. use https://jitpack.io. And now... things get REALLY confusing! Do you see why?Because https://github.com/google/adk-java/tree/cec9ef3cf25e58bd7460fb99ceef2dabe0a64932 (the state of the
mainbranch today) is NOT v0.1.0 (anymore) - of course! But themvn installfrom the previous step just overwrote~/.m2/repository/com/google/adk/google-adk/0.1.0/google-adk-0.1.0.jar.The way about a million Maven projects out there do this is simply be incrementing the version in the POM as soon as (right after) a version is actually released. This is essentially a "de facto standard best practice" with Maven. The Maven Deploy Plugin even does this completely automatically!
That's why the version in a Maven POM on a
mainbranch should always be aSNAPSHOTof some upcoming planned future release. Ergo, since0.1.0has already been released, what's now on themainbranch is what's (eventually) going to be (thus today a "SNAPSHOT" of) what will later be a0.1.1. (Or a0.2.0, or a1.0.0, or whatever number. What exactly that number is is much less important, and a sort of separate conversation. The real point is simply that it should never ever still be the version of something that was ALREADY released. One might even further bump it later again, e.g. if initially only a maintenance patch release was planned, but then that never was required and only directly a major release came out? Then no worries, no harm done, the0.1.1-SNAPSHOTcan be changed again, on themainbranch, to e.g. a0.2.0-SNAPSHOT, at any suitable later time.)I hope that this helps to clarify. Please let me know if this explanation is not clear enough, and I'm happy to help.
@glaforge FYI