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

Move artifact publishing from JCenter to Maven Central #81

Merged
merged 6 commits into from
Mar 3, 2021

Conversation

emarc-m
Copy link
Contributor

@emarc-m emarc-m commented Feb 27, 2021

This PR addresses #79 and #60.

Changes:

I published version 1.4.2 in https://repo1.maven.org/maven2/com/getkeepsafe/relinker/relinker/ based from this PR while testing the publishing process and ensuring credentials configurations work.

I'll publish another version 1.4.3 to have everything tagged and update the README page.

Thanks to:

@emarc-m emarc-m self-assigned this Feb 27, 2021
@emarc-m emarc-m changed the title [WIP] Move artifact publishing from JCenter to Maven Central Move artifact publishing from JCenter to Maven Central Feb 27, 2021
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:4.1.2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do this upgrade at the same time? Seems like it is probably unrelated to publishing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. Without updating the build tools version, the gradle-maven-publish-plugin breaks with an error:

Caused by: org.gradle.api.UnknownDomainObjectException: SoftwareComponentInternal with name 'release' not found.

Since @barnhill will be creating another PR to update the dependencies, I opted to update this to the latest that matches the stable version for Android Studio.

}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
gradlePluginPortal()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is gradlePluginPortal() necessary here?

Copy link
Contributor Author

@emarc-m emarc-m Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also vote to keep this as is and address this in another PR when a new version needs to be published.

My reasoning is that since trove4j is a transitive dependency for Android Build Tools, it might be removed in the next release version for the build tools as mentioned or be moved to Maven Central as well since JCenter will shut down.

I feel the work around would potentially hide what happened to this.

I'll add a TODO comment on the repository declaration as a note for us when we publish and it breaks.

@barnhill
Copy link
Contributor

barnhill commented Feb 28, 2021 via email

@benjamin-bader
Copy link
Contributor

benjamin-bader commented Feb 28, 2021

Yep ... If you take it out it won't compile. Brad Barnhill, MSN, RN [email protected]

Ah, our old friend trove4j, only available on jcenter (and transitively via gradlePluginPortal() which mirrors jcenter). I understand that newer versions of the Android Build Tools will not have this dependency. I'm not sure that this is a long-term solution - when jcenter shuts down, it's not clear that trove4j will still be available on the plugin portal.

There's a workaround I've seen floating around the Android world, which is to redirect that dependency to a version available on Maven Central, like so:

// in build.gradle
buildscript {
  // repositories { ... }

  // dependencies { ... }

  configurations.configureEach {
    resolutionStrategy.eachDependency {
      if (requested.group == "org.jetbrains.trove4j" && requested.name == "trove4j" && requested.version == "20160824") {
        useTarget("org.jetbrains.intellij.deps:trove4j:1.0.20181211")
      }
    }
  }
}

This would let us avoid adding the extra repository, and be perhaps more stable long-term.

@barnhill
Copy link
Contributor

barnhill commented Mar 1, 2021

I would vote to leave it be for now and if it stops building then resort to more exotic fixes such as this. But then again this isnt my repo. I fully expect whoever is pulling it in will have this fixed before it goes away on JCenter.

@emarc-m
Copy link
Contributor Author

emarc-m commented Mar 1, 2021

Thank you @benjamin-bader and @barnhill for taking a look at this PR.

I'll merge this in on 03/03/2021, update the README and publish version 1.4.3 on Maven Central.

Please let me know if there are any other changes needed before I merge this in. Thank you.

@emarc-m emarc-m merged commit 305cb83 into master Mar 3, 2021
@emarc-m emarc-m deleted the emarc/maven-central-publish branch March 3, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants