jitpack / jitpack.io

Documentation and issues of https://jitpack.io
MIT License
2.54k stars 187 forks source link

Jitpack doesn't report the classifier correctly in *.module files #4519

Closed msx80 closed 2 years ago

msx80 commented 3 years ago

Describe the bug

There's a difference between the module files i get from jitpack and locally by maven, in regards to classifiers. For example, starting with this dependency (notice the natives-desktop classifier):

dependencies { api group: 'com.badlogicgames.gdx', name: 'gdx-backend-lwjgl3', version: '1.9.10' api "com.badlogicgames.gdx:gdx-platform:1.9.10:natives-desktop" }

i get the following in the module file when building locally:

{ "group": "com.badlogicgames.gdx", "module": "gdx-platform", "version": { "requires": "1.9.10" }, "thirdPartyCompatibility": { "artifactSelector": { "name": "gdx-platform", "type": "jar", "extension": "jar", "classifier": "natives-desktop" } } }

When built on jitpack, i get this (it misses the artifactSelector):

{ "group" : "com.badlogicgames.gdx", "module" : "gdx-platform", "version" : { "requires" : "1.9.10" } } You can see an example here.

This problems causes issues when generating the classpath, for example with "sourceSets.main.runtimeClasspath.getAsPath()", for example in a run task.

To Reproduce Steps to reproduce the behavior:

  1. create a gradle project with a dependency with classifier
  2. run gradle publishToMavenLocal and observe the correct .module
  3. run jitpack on it
  4. observe the different .module

Expected behavior

It should generate a correct .module file. As far as i have observed, if a dependency is in the gradle cache (.gradle\caches\modules-2\files-2.1) it needs a correct module file to generate the correct classpath, while if it is on the maven cache (.m2\repository) it works correctly.

github-actions[bot] commented 2 years ago

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

github-actions[bot] commented 2 years ago

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