sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Gradle pom.xml incorrect metadata redirection

Open darekdeo opened this issue 2 years ago • 9 comments

Integration

sentry-android

Build System

Gradle

AGP Version

Any

Proguard

Disabled

Version

Every

Steps to Reproduce

  1. Open for example current newest version: https://repo1.maven.org/maven2/io/sentry/sentry-android/6.4.1/sentry-android-6.4.1.pom
  2. Find it contains this line: do_not_remove: published-with-gradle-metadata
  3. Open directory: https://repo1.maven.org/maven2/io/sentry/sentry-android/6.4.1/
  4. Find there is no .module file. According to gradle documentation this is incorrect: https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html

Above is description of an cause.

The more important symptoms and in fact issues are while using artifactory: https://jfrog.com/artifactory/ which will throw 403, stopping the gradle build with failure.

Expected Result

Either:

  1. pom.xml shouldn't contain line: do_not_remove: published-with-gradle-metadata
  2. .module file should be published

Actual Result

pom.xml contains line do_not_remove: published-with-gradle-metadata and there is no published .module file (Gradle Module Metadata)

darekdeo avatar Sep 05 '22 18:09 darekdeo

@darekdeo thanks for raising this. We'll look into it and report back here once we know more.

adinauer avatar Sep 06 '22 06:09 adinauer

There's a draft PR that should address this issue: https://github.com/getsentry/craft/pull/412

adinauer avatar Sep 14 '22 14:09 adinauer

https://discuss.gradle.org/t/how-to-disable-using-gradle-module-metadata-then-to-use-pom-xml-to-resolve-dependencies/42995/2 a guy from gradle says

And for the future, it is almost always a bad idea to ignore the metadata or to not publish it.

nienienienie avatar Sep 23 '22 07:09 nienienienie

FYI: For sentry-compose the gradle module metadata file generation has been disabled, see https://github.com/getsentry/sentry-java/pull/2430 for more details. If we want to support .module files, this needs to be re-checked again.

markushi avatar Dec 15 '22 15:12 markushi

We still have to finalize the open craft PR https://github.com/getsentry/craft/pull/412 to have this resolved. Maybe @buenaflor will take care of it when he's back again.

romtsn avatar Jan 25 '23 14:01 romtsn

Need to check if that works automatically after https://github.com/getsentry/craft/pull/412 is merged

romtsn avatar Mar 08 '23 14:03 romtsn

@romtsn can you release a patch and see if it works? https://github.com/getsentry/craft/pull/412 is merged

marandaneto avatar Mar 14 '23 16:03 marandaneto

Currently .module files are only supported automatically through kmp configuration so for non-kmp targets it needs a bit of extra work. See: https://github.com/getsentry/craft/blob/3a136a5dbd40e9b2e7fe7ae7799cfbf71784108e/src/targets/maven.ts#L466

buenaflor avatar Mar 14 '23 17:03 buenaflor

Noting that sentry-android 7.3.0 still does not have Gradle module metadata.

https://repo.maven.apache.org/maven2/io/sentry/sentry-android/7.3.0/

yogurtearl avatar Feb 01 '24 13:02 yogurtearl

hey, just an update here: 7.10.0 should have the gradle module metadata published. thanks for bearing with us!

https://repo.maven.apache.org/maven2/io/sentry/sentry-android-core/7.10.0/sentry-android-core-7.10.0.module

romtsn avatar Jun 07 '24 18:06 romtsn