hazelcast / hazelcast-code-samples

Hazelcast Code Samples
www.hazelcast.org
548 stars 596 forks source link

Remove dependencies on old versions #420

Open kwart opened 4 years ago

kwart commented 4 years ago

We have many samples that work either directly or transitively with old Hazelcast versions. It leads to runtime problems (CNFEs for instance).

The following check was done for Hazelcast tag v4.0.1

mvn dependency:tree -Dverbose -DoutputFile=/tmp/dependency.txt -DappendOutput=true

egrep ':hazelcast-all:jar|:hazelcast:jar|:hazelcast-enterprise:jar|:hazelcast-enterprise-all:jar' /tmp/dependency.txt |
  grep -v 4\.0\.1 |
  sed 's#^.*\(com.hazelcast.*:compile\).*#\1#' |
  sort -u

com.hazelcast:hazelcast-all:jar:3.10.2:compile
com.hazelcast:hazelcast-all:jar:3.11.2:compile
com.hazelcast:hazelcast-all:jar:3.12.2:compile
com.hazelcast:hazelcast-all:jar:3.9.1:compile
com.hazelcast:hazelcast-all:jar:3.9:compile
com.hazelcast:hazelcast-enterprise:jar:3.11:compile
com.hazelcast:hazelcast:jar:3.10.2:compile
com.hazelcast:hazelcast:jar:3.11.4:compile
com.hazelcast:hazelcast:jar:3.11:compile
com.hazelcast:hazelcast:jar:3.12.2:compile
com.hazelcast:hazelcast:jar:3.12:compile
com.hazelcast:hazelcast:jar:3.7.5:compile
com.hazelcast:hazelcast:jar:3.7.7:compile
com.hazelcast:hazelcast:jar:3.7.8:compile
com.hazelcast:hazelcast:jar:3.7:compile
com.hazelcast:hazelcast:jar:3.9.1:compile
com.hazelcast:hazelcast:jar:3.9.3:compile
com.hazelcast:hazelcast:jar:3.9:compile

If we are not able to provide a code-sample with correct Hazelcast dependency, we should drop the sample from the related release (/tag).

We provide code samples archive as a separate download for every IMDG release, so it's a shame when the sample doesn't work with the given Hazelcast version.

manueljordan commented 4 years ago

Hello

If is possible indicate through the readme documentation how execute the samples with a specific Hazelcast version, would be nice, otherwise the latest stable of Hazelcast, i.e: 4.0.x, should be used by default. Removing all release of Hazelcast is nice to save disk space about Maven's repository.

Just sharing thoughts

mmedenjak commented 4 years ago

@manueljordan ideally, we should check the code samples with each release of Hazelcast to see if they all compile and run. Also, we do maintain backwards-compatibility so code samples for Hazelcast 4.0 should work with Hazelcast 4.1 and I don't believe we necessarily need to always update code samples to the latest release.

That said, I believe we've updated most, if not all, code samples to Hazelcast 4.0 and removed some that were obsolete. I don't believe we'll maintain instructions to run code samples with older versions since, as I said, we maintain backwards-compatibility and you should seamlessly run a code sample with another minor version. If you want to see code samples for older versions, you can always download an older version of IMDG (https://hazelcast.org/imdg/download/archives/#hazelcast-imdg). Once we release a major version, we'll possibly have to adapt all the code samples again.

manueljordan commented 4 years ago

Hello @mmedenjak

Yes, I understand and I am agree with all

That said, I believe we've updated most, if not all, code samples to Hazelcast 4.0 and removed some that were obsolete

Of course, something to keep for example the following branches 3.2.x, 3.3.x, 4.0.x and 4.1.x with the latest or higher release.

Therefore for example to avoid for the 4.0.x branch:

4.0.1 (should be removed)
4.0.2 (should be removed)
4.0.3 <--- should be the unique available

Then later

4.0.3 (should be removed)
4.0.4 <--- should be the unique available

IMHO it would/should be applied to Spring Framework transitivies dependencies too, where I see for example:

5.2.5
5.2.6
5.2.7

Therefore the main goal is save space in the Maven's local repository

Again, sharing polite thoughts to this project.