Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Gradle integration test to catch differences in dependencies #19

Merged

Conversation

jjohannes
Copy link
Contributor

It now fails if the dependencies in Gradle Metadata differ from the dependencies in the corresponding POM.

See: FasterXML/jackson-core#999

@jjohannes
Copy link
Contributor Author

The test currently fails with these issues which should be fixed in the next Jackson release:

  Dependencies of com.fasterxml.jackson.core:jackson-core:2.15.0 are wrong in Gradle Metadata:
    POM:
    Gradle: ch.randelshofer:fastdoubleparser:0.8.0
  Dependencies of com.fasterxml.jackson.jr:jackson-jr-stree:2.15.0 are wrong in Gradle Metadata:
    POM:    com.fasterxml.jackson.core:jackson-core:2.15.0
    Gradle: com.fasterxml.jackson.core:jackson-core:2.15.0, com.fasterxml.jackson.jr:jackson-jr-objects:2.15.0
  Dependencies of com.fasterxml.jackson.module:jackson-module-afterburner:2.15.0 are wrong in Gradle Metadata:
    POM:    com.fasterxml.jackson.core:jackson-core:2.15.0, com.fasterxml.jackson.core:jackson-databind:2.15.0
    Gradle: com.fasterxml.jackson.core:jackson-core:2.15.0, com.fasterxml.jackson.core:jackson-databind:2.15.0, org.ow2.asm:asm:9.4

core is this: FasterXML/jackson-core#999
jackson-module-afterburner is similar (also uses the shade plugin)
jackson-jr-stree uses an optional dependencies - that's a bug in the gradle-metadata plugin that is now also fixed in 0.4.0

To fix these:

      <plugin>
        <groupId>de.jjohannes</groupId>
        <artifactId>gradle-module-metadata-maven-plugin</artifactId>
        <configuration>
          <removedDependencies>
            <dependency>
              <groupId>ch.randelshofer</groupId>
              <artifactId>fastdoubleparser</artifactId>
            </dependency>
          </removedDependencies>
        </configuration>
      </plugin>
  • In jackson-module-afterburner configure the plugin like this:
      <plugin>
        <groupId>de.jjohannes</groupId>
        <artifactId>gradle-module-metadata-maven-plugin</artifactId>
        <configuration>
          <removedDependencies>
            <dependency>
              <groupId>org.ow2.asm</groupId>
              <artifactId>asm</artifactId>
            </dependency>
          </removedDependencies>
        </configuration>
      </plugin>

@cowtowncoder
Copy link
Member

cowtowncoder commented Apr 27, 2023

@jjohannes Since I created 2.15 branch, and master is for 2.16.0-SNAPSHOT, could you rebase this to 2.15? I think we want to fix the issue for 2.15.1 Jackson release.

@cowtowncoder
Copy link
Member

@jjohannes I think same is also needed for jackson-module-mrbean in jackson-modules-base.

@cowtowncoder
Copy link
Member

cowtowncoder commented Apr 27, 2023

Fixed for:

So once we get tests updated we should be ok.

It now fails if the dependencies in Gradle Metadata differ from the
dependencies in the corresponding POM.

See: FasterXML/jackson-core#999
@jjohannes jjohannes force-pushed the extend-gradle-integration-test branch from 6a38c36 to c62303c Compare April 28, 2023 04:30
@jjohannes jjohannes changed the base branch from master to 2.15 April 28, 2023 04:30
@jjohannes
Copy link
Contributor Author

Rebase done. Let me know if there is anything else I can help with.

@cowtowncoder cowtowncoder merged commit f4b7364 into FasterXML:2.15 Apr 28, 2023
@cowtowncoder
Copy link
Member

cowtowncoder commented Apr 28, 2023

Looks like jackson-jr shading also needs fixing (makes sense) for jr-stree; already finding issues.

Although not sure why jackson-module-mrbean not included as failure wrt 2.15.0.

EDIT: jr-stree is tricky one; pom.xml adds optional dependency so not sure if it's wrong or not

@cowtowncoder
Copy link
Member

@jjohannes Looks like GradleTest only tests non-SNAPSHOT versions? I updated jackson-bom dependency to 2.15.1-SNAPSHOT which will then get 2.15.1-SNAPSHOT of all Jackson components -- but GMM test seems to check 2.15.0 only.

It would be great if snapshot builds could be tested too as that way I could validate fixes: would this be possible?
Or am I doing something wrong?

@jjohannes
Copy link
Contributor Author

  • jr-stree - should be fine when you use the 0.4.0 plugin version. It's a bugfix in the plugin. Nothing to do on your side except for publishing a snapshot again with the newer plugin version.
  • jackson-module-mrbean - the shade plugin is (was?) not configured there to write the minimized POM. The ASM dependency is also still there int the POM: https://repo1.maven.org/maven2/com/fasterxml/jackson/module/jackson-module-mrbean/2.15.0/jackson-module-mrbean-2.15.0.pom
  • Testing against SNASHOT The test is currently set-up to test against the latest release. It's totally independent of what's in the integration test POM right now. Not sure what's the best general setup would be. Do the following adjustments in src/test/resources/com/fasterxml/jackson/integtest/gradle/build.gradle.kts (Line 15 onwards) to test against 2.15.1-SNAPSHOT:
dependencies {
    implementation(platform("com.fasterxml.jackson:jackson-bom:2.15.1-SNAPSHOT"))
}

repositories.maven("https://oss.sonatype.org/content/repositories/snapshots")
repositories.mavenCentral()

@cowtowncoder
Copy link
Member

cowtowncoder commented Apr 28, 2023

@jjohannes Ok cool wrt jr-stree. On mrbean I guess I'll need to see diffs from Afterburner's approach.

On SNAPSHOTs that should work for my immediate needs, but I am curious as to where the version by default comes
from? (I wouldn't want to hard-code version there; but can leave commented out I think)

EDIT: n/m, above it does show what "latest" version means here.

@cowtowncoder
Copy link
Member

@jjohannes With 2.15.1-SNAPSHOT it turns out that:

  1. MrBean is complained about (GMM actually excludes Asm fine :) )
  2. jr-stree is complained about still

(and jackson-core and jackson-module-afterburner are resolved now)

@cowtowncoder
Copy link
Member

cowtowncoder commented May 19, 2023

Actually GMM is correct for Mr Bean, it's Maven dependencies that are wrong (I did fix Mr Bean and Afterburner both, via #205)
So need to address that instead.

@cowtowncoder
Copy link
Member

@jjohannes I am having some trouble verifying fix via FasterXML/jackson-modules-base#208 -- I can modify src/test/resources/com/fasterxml/jackson/integtest/gradle/build.gradle.kts to use version 2.15.2-SNAPSHOT, but somehow it seems test downloads older (3 day old) snapshot version instead of newly deployed one. I cleared local Maven cache, but wondering if Gradle might have some cache of its own.

@cowtowncoder
Copy link
Member

Looks like new version is now available, and failure is resolved.

@jjohannes jjohannes deleted the extend-gradle-integration-test branch January 8, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants