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 to Bintray for Mapbox Java SDK releases #995

Closed
osana opened this issue Apr 11, 2019 · 14 comments · Fixed by #1037
Closed

Move to Bintray for Mapbox Java SDK releases #995

osana opened this issue Apr 11, 2019 · 14 comments · Fixed by #1037
Assignees
Milestone

Comments

@osana
Copy link
Contributor

osana commented Apr 11, 2019

Right now, Mapbox Java Sdk uses Sonatype to pass release files on to MavenCentral.
Recently, Maps SDK Android switched to using Bintray.
We want to align the release process used in those two projects and to use Bintray for Mapbox Java Sdk releases.

Here is the PR used to move to Bintray in Maps SDK Android for reference.

@langsmith
Copy link

langsmith commented Apr 12, 2019

Love the idea of getting more projects on to the same platform. Bintray integrations and its UI are all great.

@osana osana added this to the v4.8.0 milestone Apr 18, 2019
@langsmith
Copy link

I added the needed environment variables to the Java SDK project in CircleCI

@langsmith
Copy link

@langsmith
Copy link

Ok @osana & @LukasPaczos , https://github.com/mapbox/mapbox-java/pull/new/ls-moving-release-process-to-bintray has my most up-to-date work.

One thing I thought about looking into is using a different Bintray publishing plugin, such as https://github.com/novoda/bintray-release . Perhaps a different plugin can handle the multiple components that are in the services package.

@osana osana modified the milestones: v4.8.0, v4.9.0 May 7, 2019
@LukasPaczos
Copy link
Contributor

Perhaps a different plugin can handle the multiple components that are in the services package.

Now that I think about it, what's the issue with pushing each artifact separately to Bintray? We'll probably still need to click the sync button on each artifact separately. Your current setup seems to be adapted well to do that, are you running into any issues?

The only piece that I think might be missing is that we need to recognize in the Makefile#publish or CI script whether a version is a SNAPSHOT or a stable/alpha version which was previously handled by the maven-release plugin.

@osana osana assigned langsmith and unassigned osana May 9, 2019
@langsmith
Copy link

pushing each artifact separately to Bintray

Not sure what you mean. Can you elaborate? You're suggesting each API wrapper artifact (optimization, mapmatching, etc.) should be sent separately to Bintray first? Or something different?

The only piece that I think might be missing is that we need to recognize in the Makefile#publish or CI script whether a version is a SNAPSHOT or a stable/alpha version which was previously handled by the maven-release plugin.

Ok, will look into this. Working off of mapbox/mapbox-gl-native#14067, I pushed/re-based changes to start the work of setting the SNAPSHOT repository to https://oss.jfrog.org/artifactory/oss-snapshot-local/. If this shouldn't be done, let me know.

@LukasPaczos
Copy link
Contributor

You're suggesting each API wrapper artifact (optimization, mapmatching, etc.) should be sent separately to Bintray first? Or something different?

No, phrased that poorly. We have 4 releasable modules, core, services, geojson, turf. All those non-releasable modules are declared as code source sets for services, not as dependencies, so there should be no issues here.

Perhaps a different plugin can handle the multiple components that are in the services package.

Just a hunch, but this error might be thrown because you are first applying the bintray plugin that defines a publication to, for example, core and then using that as a dependency in services which applies the bintray plugin again.

Another issue might arise when we get to dependencies on other projects, for example:

api project(":services-geojson")

or
api project(":services-core")
api project(":services-geojson")

those dependencies might not be picked up in POM (or are represented poorly, like unknown or wrong artifact names).

References in the POM to those modules need to be based on their Maven releases. Gradle is unable to determine if, or which version of the artifact it should use because we are consuming a local module.

So, whenever we release a module, during the POM generation we need to iterate through all of its dependencies and for each local dependency we need to overwrite that module value with a correct artifact name and version of the most recent Maven release of that dependency. We can either store those locally, next to the current SNAPSHOT version name or query them from the Maven repository.

@LukasPaczos
Copy link
Contributor

When it comes to snapshots, we need to first create a new project in https://bintray.com/mapbox/mapbox/ (this is needed for regular releases as well) and request JCenter access to be able to push to the snapshot repository.

@osana
Copy link
Contributor Author

osana commented May 10, 2019

A bit of a side note but maybe it would be helpful.

It is easy to merge service-core into services.
Dependency on service-core in services-geojson is minimal.

But if we want to be able to release each of the sub-services individually than this is not actionable.

@langsmith
Copy link

Still lots to fix, but I made good progress today 👍 make build-release and then make publish was able to push files to Bintray

Screen Shot 2019-05-16 at 3 26 12 PM

See page 2 of https://bintray.com/mapbox/mapbox

https://bintray.com/mapbox/mapbox/mapbox-sdk-services/4.9.0-SNAPSHOT#files/com/mapbox/mapboxsdk/services/4.9.0-SNAPSHOT

Screen Shot 2019-05-16 at 3 28 38 PM
Screen Shot 2019-05-16 at 3 28 35 PM

@langsmith
Copy link

Also, seems that the Java wrappers (optimization, mapmatching, etc.) were successfully included in the services module. 👇 is from unzipping the services module's .jar file found at https://bintray.com/mapbox/mapbox/mapbox-sdk-services#files/com/mapbox/mapboxsdk/services/4.9.0-SNAPSHOT

Screen Shot 2019-05-16 at 3 47 00 PM

@langsmith
Copy link

@LukasPaczos , a couple of things based on my latest update above:

Regarding my past 💥 of cannot include multiple components:
This seems to have been solved by adding the two lines within subprojects rather than pasting apply plugin: "${rootDir}/gradle/gradle-bintray.gradle" in the four release modules' build.gradle files.

Now that I think about it, what's the issue with pushing each artifact separately to Bintray? We'll probably still need to click the sync button on each artifact separately. Your current setup seems to be adapted well to do that, are you running into any issues?

Seems that my current setup is successfully doing this. Each of the 4 packages is separate on Bintray.

The only piece that I think might be missing is that we need to recognize in the Makefile#publish or CI script whether a version is a SNAPSHOT or a stable/alpha version which was previously handled by the maven-release plugin.

Still need to figure this out.

So, whenever we release a module, during the POM generation we need to iterate through all of its dependencies and for each local dependency we need to overwrite that module value with a correct artifact name and version of the most recent Maven release of that dependency. We can either store those locally, next to the current SNAPSHOT version name or query them from the Maven repository.

So, below is the services POM file. Let's say that the 4.9.0 release is going out. https://github.com/mapbox/mapbox-java/blob/master/gradle.properties#L2 would be adjusted to 4.9.0, so it'd be 4.9.0 everywhere where it currently says 4.9.0-SNAPSHOT in the POM file below. Would this work? I'm not sure how this is different from what you're suggesting. Perhaps I'm just not seeing a big problem staring me in the face.
Screen Shot 2019-05-16 at 4 44 15 PM

those dependencies might not be picked up in POM (or are represented poorly, like unknown or wrong artifact names).

Seems that the plugin correctly picked up the dependencies, right?

@LukasPaczos
Copy link
Contributor

Yes, seems like the POM is fine 🚀

@langsmith
Copy link

Created a pr for the work discussed above #1037

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

Successfully merging a pull request may close this issue.

3 participants