wcm-io / io.wcm.maven.aem-cloud-dependencies

Maven dependencies for the AEM Cloud Service SDK
https://wcm.io/tooling/maven/aem-dependencies.html
Apache License 2.0
2 stars 3 forks source link

test compile fails when upgrading from 2024.4.15860.20240410T113939Z-240300 to latest release #62

Closed mitcoding closed 1 month ago

mitcoding commented 2 months ago

For some reason starting with release 2024.5.16357.20240517T163826Z-240400 the test compile phase fails because maven dependency management auto downgrades johnzon-core, jakarta.json, jakarta.json-api, & org.apache.sling:org.apache.sling.contentparser.json (compare the two attached dependency tree files attached).

2024.4.15860.20240410T113939Z-240300 -- Dependency Tree 2024.6.16799.20240614T073455Z-240500 -- Dependency Tree

the fix needed was to manually add to our root pom:

<dependency>
        <groupId>org.apache.johnzon</groupId>
        <artifactId>johnzon-core</artifactId>
        <version>2.0.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>jakarta.json</groupId>
    <artifactId>jakarta.json-api</artifactId>
    <version>2.1.1</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>jakarta.json</artifactId>
    <version>2.0.1</version>
    <scope>test</scope>
</dependency>
stefanseifert commented 2 months ago

this sounds a bit similar to #60, see also my explanation in that issue for the reasons.

can you post here what are the actual problems you observed (e.g. stack traces) before manually adjusting the dependencies?

royteeuwen commented 1 month ago

I can say that at my side the issue is also fixed when adding the three libraries mentioned by @mitcoding .

I checked and we are not overriding the johnzon core nor geronimo from cloud-dependencies. The effective pom of our core bundle shows these versions:

<dependency>
        <groupId>org.apache.sling</groupId>
        <artifactId>org.apache.sling.commons.johnzon</artifactId>
        <version>2.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.johnzon</groupId>
        <artifactId>johnzon-core</artifactId>
        <version>1.2.21</version>
      </dependency>
      <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-json_1.1_spec</artifactId>
        <version>1.3</version>
      </dependency>
stefanseifert commented 1 month ago

ok, i will apply a "fix forward" solution by switching back to JSONP 2.1 and Johnzon 2.0 by defaul in PR #66

additionally we prove a "mixin" POM to optionally switch back to JSONP 1.1 for projects that require it: https://github.com/wcm-io/io.wcm.maven.aem-cloud-dependencies-mixin-jsonp11