adobe / aio-lib-java

Adobe I/O - Java SDK
https://opensource.adobe.com/aio-lib-java/
Apache License 2.0
5 stars 18 forks source link

Made the code compatible with java 8 #129

Closed pulguptaAdobe closed 1 year ago

pulguptaAdobe commented 1 year ago

Description

With this change I have made the SDK compatible with java 8 so that it can even work with projects who are stuck on 1.8.

Related Issue

https://github.com/adobe/aio-lib-java/issues/104

Motivation and Context

AEM Guides is not yet onJava 11 but needs integration with IO Events. This change will help Guides to use the sdk without being forced to migrate to Java 11.

How Has This Been Tested?

I tested the changes by deploying my publisher and consumer which were working with java 11 and tested them using the version which was migrated to java 8.

Screenshots (if appropriate):

Types of changes

Checklist:

pulguptaAdobe commented 1 year ago

@francoisledroff : Can you please check if we can merge and release this change?

pulguptaAdobe commented 1 year ago

@francoisledroff : even though I have done the java8 integration via a new profile but I have a few concerns:

1) It has made the pom scattered with classifiers 2) Maven does not use classifiers while resolving transitive dependencies (tried it) . So users will have exclude all transition dependencies of aio and include them again with classifier sometimes doing that a couple of time [0]. 3) We already have a aem65 classifier for all aem modules in this sdk. With Java8 profile we will add one more classifier. I am not sure if we can have more than one classifier which will be the case if we want to build for profiles java8 and aem65 4) Lastly even after all this we will not be able to write code using java 11 constructs as that would fail the Java 8 build.

[0]

         <dependency>
            <groupId>com.adobe.aio</groupId>
            <artifactId>aio-lib-java-events-journal</artifactId>
            <version>0.1.4-SNAPSHOT</version>
            <classifier>java8</classifier>
            <exclusions>
                <exclusion>
                    <groupId>com.adobe.aio</groupId>
                    <artifactId>aio-lib-java-ims</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.adobe.aio</groupId>
                    <artifactId>aio-lib-java-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.adobe.aio</groupId>
            <artifactId>aio-lib-java-ims</artifactId>
            <version>0.1.4-SNAPSHOT</version>
            <classifier>java8</classifier>
            <exclusions>
                <exclusion>
                    <groupId>com.adobe.aio</groupId>
                    <artifactId>aio-lib-java-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.adobe.aio</groupId>
            <artifactId>aio-lib-java-core</artifactId>
            <version>0.1.4-SNAPSHOT</version>
            <classifier>java8</classifier>
        </dependency>
francoisledroff commented 1 year ago

I see... may be we should just downgrade the java baseline to java8, as you first proposed. let me sync up with my team...

francoisledroff commented 1 year ago

could you re-work your PRs the simple way, a bit like you first did, but publishing the artifact with a jdk8 classifier, and we'll push the change to a jdk8 remote branch and release from there ...

francoisledroff commented 1 year ago

thanks for your PR @pulguptaAdobe I'll merge this into our java8 remote branch and I'll polish it with another PR (tackling https://github.com/adobe/aio-lib-java/issues/21 ) stay tuned.

francoisledroff commented 1 year ago

see https://github.com/adobe/aio-lib-java/pull/130