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

v4.0.0 compatibility issue with Java 8 #702

Closed
abelsromero opened this issue Jan 9, 2024 · 8 comments
Closed

v4.0.0 compatibility issue with Java 8 #702

abelsromero opened this issue Jan 9, 2024 · 8 comments
Labels
4.x Issues related to the 4.x series bug
Milestone

Comments

@abelsromero
Copy link
Member

I am unable to bump form 3.3.2 to 4.0.0

- Variant 'runtimeElements' capability org.asciidoctor:asciidoctor-gradle-jvm:4.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
    - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
    - Other compatible attribute:
        - Doesn't say anything about org.gradle.plugin.api-version (required '7.6.2')

More data:

  • Other branches in the same repo with the same configuration but Java > 11 are working fine.
  • asciidoctor-gradle-jvm-4.0.0.module from local /caches actually mentions java "org.gradle.jvm.version": 11,. Code seems fine: CI; sourceCompatibility... is using Java8, but maybe the module picked up the version used during the release?
{
  "formatVersion": "1.1",
  "component": {
    "group": "org.asciidoctor",
    "module": "asciidoctor-gradle-jvm",
    "version": "4.0.0",
    "attributes": {
      "org.gradle.status": "release"
    }
  },
  "createdBy": {
    "gradle": {
      "version": "7.0.2"
    }
  },
  "variants": [
    {
      "name": "apiElements",
      "attributes": {
        "org.gradle.category": "library",
        "org.gradle.dependency.bundling": "external",
        "org.gradle.jvm.version": 11,
        "org.gradle.libraryelements": "jar",
        "org.gradle.usage": "java-api"
      },
      "dependencies": [
        {
          "group": "org.ysb33r.gradle",
          "module": "grolifant-herd",
          "version": {
            "requires": "2.2.1"
          }
        },
        {
          "group": "org.asciidoctor",
          "module": "asciidoctor-gradle-base",
          "version": {
            "requires": "4.0.0"
          }
        }
      ],
      "files": [
        {
          "name": "asciidoctor-gradle-jvm-4.0.0.jar",
          "url": "asciidoctor-gradle-jvm-4.0.0.jar",
          "size": 171502,
          "sha512": "c0aa3da94e7d8c4e211c4efebbe07e612bb5696f6571507515d724fd8d2e5212b362b784d1dd2f50f17a476a09fc38bf89b182a6ea6797c1250b54c2c82dd860",
          "sha256": "9e395fe76b629b4e16e4953806a55e516d640c94d4992b746998f9911a4dffcb",
          "sha1": "d7559f3bd9fe8eef8521f0e31d67bf7c77a4bbab",
          "md5": "f9690772be18d488b687e284f4dce51e"
        }
      ]
    },
    {
      "name": "runtimeElements",
      "attributes": {
        "org.gradle.category": "library",
        "org.gradle.dependency.bundling": "external",
        "org.gradle.jvm.version": 11,
        "org.gradle.libraryelements": "jar",
        "org.gradle.usage": "java-runtime"
      },
      "dependencies": [
        {
          "group": "org.ysb33r.gradle",
          "module": "grolifant-rawhide",
          "version": {
            "requires": "2.2.1"
          }
        },
        {
          "group": "org.ysb33r.gradle",
          "module": "grolifant-herd",
          "version": {
            "requires": "2.2.1"
          }
        },
        {
          "group": "org.asciidoctor",
          "module": "asciidoctor-gradle-base",
          "version": {
            "requires": "4.0.0"
          }
        },
        {
          "group": "org.asciidoctor",
          "module": "asciidoctorj-api",
          "version": {
            "requires": "2.5.7"
          }
        }
      ],
      "files": [
        {
          "name": "asciidoctor-gradle-jvm-4.0.0.jar",
          "url": "asciidoctor-gradle-jvm-4.0.0.jar",
          "size": 171502,
          "sha512": "c0aa3da94e7d8c4e211c4efebbe07e612bb5696f6571507515d724fd8d2e5212b362b784d1dd2f50f17a476a09fc38bf89b182a6ea6797c1250b54c2c82dd860",
          "sha256": "9e395fe76b629b4e16e4953806a55e516d640c94d4992b746998f9911a4dffcb",
          "sha1": "d7559f3bd9fe8eef8521f0e31d67bf7c77a4bbab",
          "md5": "f9690772be18d488b687e284f4dce51e"
        }
      ]
    },
    {
      "name": "javadocElements",
      "attributes": {
        "org.gradle.category": "documentation",
        "org.gradle.dependency.bundling": "external",
        "org.gradle.docstype": "javadoc",
        "org.gradle.usage": "java-runtime"
      },
      "files": [
        {
          "name": "asciidoctor-gradle-jvm-4.0.0-javadoc.jar",
          "url": "asciidoctor-gradle-jvm-4.0.0-javadoc.jar",
          "size": 143790,
          "sha512": "7e1831df4ba999b862eeeffc13a797faf9a0fe0d12c5de9d2dca26fc71d8cc07f045909348e069a71618a4a024af31e37fdbd0218fcfc2cf2b329137ca467202",
          "sha256": "ffe0a6d6b157ef4c44e1b1afc450f7ab3ad4422d0c5ebcb89a8af8d179b569db",
          "sha1": "48992e6811001724068f7dcaba6a1be31c205b15",
          "md5": "382d424304917025e19052d02d8b3300"
        }
      ]
    },
    {
      "name": "sourcesElements",
      "attributes": {
        "org.gradle.category": "documentation",
        "org.gradle.dependency.bundling": "external",
        "org.gradle.docstype": "sources",
        "org.gradle.usage": "java-runtime"
      },
      "files": [
        {
          "name": "asciidoctor-gradle-jvm-4.0.0-sources.jar",
          "url": "asciidoctor-gradle-jvm-4.0.0-sources.jar",
          "size": 42674,
          "sha512": "95845ebb152345ff7eb034fe54303c0451de13fc419c4957678fb86709e9674e75d7c67b17222a93875e9811d20c2377739e9e3ef885948661fe2cc05dbf6963",
          "sha256": "426555c974cdf95e00a845cf0721fea23f5619b220804e74d70bc0bb61541f28",
          "sha1": "65c30df944ae43bef8bb0a65968795bf7c65614b",
          "md5": "8248b52dbe61f728bbd108b4499b32c6"
        }
      ]
    }
  ]
}

@ysb33r
Copy link
Member

ysb33r commented Jan 9, 2024

@aalmiray When you did the release, did you use JDK8?

@ysb33r ysb33r added the bug label Jan 9, 2024
@abelsromero
Copy link
Member Author

abelsromero commented Jan 9, 2024

I could reproduce that the module is set to the JDK used, at least with publishToMavenLocal. But I am guessing, how is the release done btw?

Luckily, simply adding the toolchain to subprojects { ... } fixes it for me.

  java {
      toolchain {
          languageVersion = JavaLanguageVersion.of(8)
      }
  }

Btw, another thing, I initially got an error running publishToMavenLocal, I had to delete this

publishing.publications.withType(MavenPublication).configureEach {
pom.withXml {
asNode().appendNode('description', project.project_description)
}
}

Invalid publication 'orgasciidoctorjvmepubPluginPluginMarkerMaven': POM file is invalid. Check any modifications you have made to the POM file.

with stacktrace

Caused by: org.codehaus.plexus.util.xml.pull.XmlPullParserException: Duplicated tag: 'description' (position: START_TAG seen ...</description>\n  <description>... @10:16) 
        at org.apache.maven.model.io.xpp3.MavenXpp3Reader.checkFieldWithDuplicate(MavenXpp3Reader.java:140)

@ysb33r
Copy link
Member

ysb33r commented Jan 9, 2024

Can you PR that toolchain change, please?

@abelsromero
Copy link
Member Author

abelsromero commented Jan 9, 2024

The description change removes the description, I need to look into it more carefully. There's a dot being added at some point <description>.</description> 😮

@ysb33r
Copy link
Member

ysb33r commented Jan 9, 2024

The description change removes the description, I need to look into it more carefully. There's a dot being added at some point <description>.</description> 😮

Yes, it is coming from somewhere else. I thought it best to get the update plugin suit out, rather than worry about fixing it at that point in time.

We should anyway rather refactor that pomXml code to be done in buildSrc rather than in publishing.gradle. It should also be easy to make it conditional to only be done when the maven-publish plugin is applied in the build.

@abelsromero
Copy link
Member Author

Thanks for the quick merge.

Yes, it is coming from somewhere else. I thought it best to get the update plugin suit out, rather than worry about fixing it at that point in time.

Not a problem 👍 But then, should we get 4.0.1 asap out and create a separated issue to discuss the "description" ?

@ysb33r
Copy link
Member

ysb33r commented Jan 9, 2024

create a separated issue to discuss the "description"

Yes.

@ysb33r ysb33r added the 4.x Issues related to the 4.x series label Jan 9, 2024
@ysb33r ysb33r added this to the 4.0 milestone Jan 9, 2024
@aalmiray
Copy link
Member

aalmiray commented Jan 9, 2024

@aalmiray When you did the release, did you use JDK8?

No, I used JDK11 as that's my default these days. Sorry, I'll use JDK8 for the patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Issues related to the 4.x series bug
Projects
None yet
Development

No branches or pull requests

3 participants