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

Publish to Maven Central? #1004

Closed
madhead opened this issue Feb 3, 2021 · 25 comments
Closed

Publish to Maven Central? #1004

madhead opened this issue Feb 3, 2021 · 25 comments
Labels
important 🔥 status:accepted accepted to be developed status:checking currently in analysis - discussion or need more detailed specs
Milestone

Comments

@madhead
Copy link

madhead commented Feb 3, 2021

Starting from May 1, 2021 JCenter will stop working. I was looking for official Koin artifacts in Maven Central and didn't find any, only some repackaged ones. Do you publish only to JCenter? Are there any plans to move away?

Describe the solution you'd like
Official Koin artifacts should be available outside of JCenter, preferably in Maven Central.

Describe alternatives you've considered

Target Koin project
All of them.

@arnaudgiuliani
Copy link
Member

Maven central also. Many Kotlin libs will go on that.

@paristote
Copy link

paristote commented Feb 4, 2021

Will you republish previous releases too? Otherwise they won't be available anymore after May 1st, which will make it impossible to reproduce old builds.

@arnaudgiuliani
Copy link
Member

Yes, thanks a good point 🤔

@arnaudgiuliani arnaudgiuliani added the status:checking currently in analysis - discussion or need more detailed specs label Feb 6, 2021
@arnaudgiuliani arnaudgiuliani added this to the 3.0.1 milestone Mar 3, 2021
@arnaudgiuliani
Copy link
Member

Versions are deploying on maven central: https://search.maven.org/search?q=io.insert-koin

Note that the new maven group id is io.insert-koin instead of org.koin. Others version will follow

@madhead
Copy link
Author

madhead commented Mar 3, 2021

BTW, you may find https://github.com/gradle-nexus/publish-plugin useful to automatically close and release staging repositories in OSSRH.

@arnaudgiuliani
Copy link
Member

arnaudgiuliani commented Mar 3, 2021

Yep. will be added for next publish 👍

@Daphne-CoffeeIT
Copy link

Right now I'm using "org.koin:koin-android:2.2.2" and "org.koin:koin-android-viewmodel:2.2.2" in my app, but I have issues updating the last one since I can't find it here https://search.maven.org/search?q=io.insert-koin. When I use this combination: "io.insert-koin:koin-android:3.0.1-alpha-6" and "org.koin:koin-android-viewmodel:2.2.2" I get a lot of duplicate class errors. When I don't use the ViewModel library I can't use viewModel() or androidContext no more. I also tried combining the library with other libraries I found on the Maven website, but none of those make viewModel() or androidContext resolvable. Have they become deprecated? I can't find any information on that. Is there an alternative to use? Or is it included in another library?

@jameswald
Copy link

It sounds like @arnaudgiuliani is planning to deploy 2.2.2 to Maven Central as well as other previous versions. We're in the same situation now that we've dropped jcenter from our build.

@Daphne-CoffeeIT
Copy link

Daphne-CoffeeIT commented Mar 3, 2021

@jameswald I think you might have interpreted my question wrong (or I interpreted your answer wrong). I don't specifically need version 2.2.2 of any library, the newer the better 😄

But I'm not sure what @arnaudgiuliani meant by "other versions will follow". Other versions of the libraries that are currently on there, or other versions like -viewmodel and -architecture. So my question is whether a version of koin-android-viewmodel (or an alternative) will be available on Maven too, it doesn't really matter which version as long as viewModel() or androidContext are supported.

@xsveda
Copy link
Contributor

xsveda commented Mar 4, 2021

@DaphnevdVeeke koin-android-viewmodel artifact does not exist anymore in newer versions, it was merged to koin-android in 3.0.1-alpha-3. Thats the root of duplications you experience, the io.insert-koin:koin-android:3.0.1-alpha-6 artifact should be all you need.
See https://github.com/InsertKoinIO/koin/blob/master/CHANGELOG.md

@Daphne-CoffeeIT
Copy link

Daphne-CoffeeIT commented Mar 4, 2021

@xsveda I saw that, but then how to we use org.koin.android.viewmodel.dsl.viewModel or an equivalent reference? It's not in there, unfortunately.

Update: seems like auto import is just broken and I had to do a little guessing game, which I didn't realise yesterday night. I've got it working now. For the modules I'm able to use import org.koin.androidx.viewmodel.dsl.viewModel instead and in the fragments import org.koin.androidx.viewmodel.ext.android.viewModel. I hope this helps other people as well!

@matsujun
Copy link

matsujun commented Mar 9, 2021

Not only previous version but also current (stable) version is not exist on maven central...
There are only alpha version on maven central...

@arnaudgiuliani
Copy link
Member

current is beta-1: https://search.maven.org/search?q=io.insert-koin

@matsujun
Copy link

Beta is NOT stable version.

@jakoss
Copy link
Contributor

jakoss commented Mar 15, 2021

I think the historical versions are crucial for a lot of people. Not everybody can upgrade just like that

@arnaudgiuliani
Copy link
Member

sure, I will repush them for Q2.

@dendrocyte
Copy link

I ref. https://insert-koin.io/docs/setup/v3/ and change to MavenCentral, but found stateViewModel is not available to use.

@arnaudgiuliani
Copy link
Member

it should be available in koin-android package

@arnaudgiuliani
Copy link
Member

2.0.1, 2.1.6 & 2.2.2 have been pushed to Maven Central, as well as 3.x versions.

@soniamca17
Copy link

Its not working I am not able to use the dependency - org.koin:koin-android:2.1.6 from mavenCentral. Please help.

@OrangeDog
Copy link

@soniamca17

Note that the new maven group id is io.insert-koin instead of org.koin.

@jbvincey
Copy link

@arnaudgiuliani the documentation https://insert-koin.io/docs/setup/v2/ is not up-to-date. It points to mavenCentral but still references the group id org.koin. Could you update the documentation?
Thanks in advance 🙏

@arnaudgiuliani
Copy link
Member

Arf yes. Thanks @jbvincey, it's deploying

@arnaudgiuliani
Copy link
Member

@soniamca17 the goup id is now "io.insert-koin" and not "org.koin"

@tasomaniac
Copy link

In case the koin runtime dependency comes transitively from another dependency, the above suggestions may not be too easy to do. In case someone hits this issue, I'm leaving a solution that I found with Gradle.

It basically dynamically substitutes all of the org.koin dependencies with io.insert-koin while keeping the module name and versions intact. This might help you remove jcenter even if your dependency did not update koin yet.

    configurations.all {
        resolutionStrategy {

            dependencySubstitution {
                all {
                    val requested = this.requested as? ModuleComponentSelector
                    if (requested != null && requested.group == "org.koin") {
                        useTarget("io.insert-koin:${requested.module}:${requested.version}")
                    }
                }
            }
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
important 🔥 status:accepted accepted to be developed status:checking currently in analysis - discussion or need more detailed specs
Projects
None yet
Development

No branches or pull requests