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

Jitpack generates wrong Gradle metadata #4476

Closed
elect86 opened this issue Mar 6, 2021 · 7 comments
Closed

Jitpack generates wrong Gradle metadata #4476

elect86 opened this issue Mar 6, 2021 · 7 comments
Labels

Comments

@elect86
Copy link

elect86 commented Mar 6, 2021

Describe the bug

Wrong Gradle metadata generated from build

To Reproduce
Steps to reproduce the behavior:

  1. trigger a new build of kool
  2. Check the .module metadata file, this is wrong
    "dependencies" : [ {
      "group" : "kx.platform",
      "module" : "source",
      "version" : {
        "requires" : "0.0.9"
      }
    }, {

Expected behavior

Run the very same command locally, you should get instead the following

      "dependencies": [
        {
          "group": "kx.platform",
          "module": "source",
          "version": {
            "requires": "0.0.9"
          },
          "attributes": {
            "org.gradle.category": "platform"
          },
          "endorseStrictVersions": true
        },

This is a blocker, because downstream will cause the Idea Gradle project reload to fail because kx.platform:source:0.0.9 will be seen as a normal dependency instead of a platform

@skalarproduktraum
Copy link

I am having the same issue. Any chance for this getting fixed? Thanks 👍

@breandan
Copy link

cc: @jitpack

@elect86
Copy link
Author

elect86 commented Apr 27, 2021

For anyone having this problem, there may be a solution: in your project instead adding the dependency to a classic platform

implementation(platform("sciJava:platform:30.0.0+6"))

just apply a plugin which defines the constraints

This can play well with Gradle 7.0 catalogs with this workaround

@ljjh20
Copy link

ljjh20 commented Apr 27, 2021

I have the same issue.

@skalarproduktraum
Copy link

I have found a workaround: It works by disabling the Gradle metadata entirely, as the POM created as actually correct.

Here's the snippet that needs to be added to the build.gradle.kts:

if(System.getenv("JITPACK") != null) {
    tasks.withType<GenerateModuleMetadata> {
        enabled = false
    }
}

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label May 27, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants