https://kotlinlang.org logo
#library-development
Title
# library-development
m

Marcus Cvjeticanin

03/13/2023, 8:52 PM
If I have one project with the structure as following:
org.myorg.sdk.http
And then I have another project that have:
org.myorg.api
Could there be some conflict if I import that first one as
implementation("org.myorg.sdk:http:0.1.0")
I believe there might be something like that since when I implement it, I can't import it since it probably thinks it's in the same project but on a different path? I get the error: "Unresolved reference: sdk" How can fix this?
k

Kirill Grouchnikov

03/13/2023, 9:04 PM
For local development?
That would be something like
implementation project(':sdk:http')
Unless these are in two separate projects, and then you publish
sdk:http
to local Maven and expect your second project to get it from local Maven, maybe?
m

Marcus Cvjeticanin

03/13/2023, 9:06 PM
No, published on sonartype atm
k

Kirill Grouchnikov

03/13/2023, 9:06 PM
Link to sonatype?
m

Marcus Cvjeticanin

03/13/2023, 9:06 PM
Just a sec
k

Kirill Grouchnikov

03/13/2023, 9:08 PM
Do you have
_maven_("<https://oss.sonatype.org/content/repositories/snapshots>")
in your build file?
Or probably
_maven_("<https://s01.oss.sonatype.org/content/repositories/snapshots>")
And then it would be
org.kryptokrona.sdk:kryptokrona-http:0.1.0-SNAPSHOT
as your dependency
m

Marcus Cvjeticanin

03/13/2023, 9:12 PM
No I have only
mavenCentral()
, hmm. Gradle didn't say anything about it doesn't exist? I can't find it when i brows through "external libraries" in IntelliJ.
When I promote it to release, will it then be able to fetch from Maven Central or has I missunderstood it?
Currently it's in Staging and Snapshot
k

Kirill Grouchnikov

03/13/2023, 9:13 PM
You published a snapshot, so that’s where you would need to fetch it from
It’s
0.1.0-SNAPSHOT
which is not the same as
0.1.0
. Snapshots don’t go to the same repository (central) as real releases
m

Marcus Cvjeticanin

03/13/2023, 9:14 PM
Wow, wait a minute. That's strange. When checking inside the nexus repository manager I see this:
This is where your snapshot is
m

Marcus Cvjeticanin

03/13/2023, 9:16 PM
Ah, that is not supposed to be there I guess. It's should be in snapshot repository I think
k

Kirill Grouchnikov

03/13/2023, 9:16 PM
m

Marcus Cvjeticanin

03/13/2023, 9:16 PM
I probabaly did something wrong
k

Kirill Grouchnikov

03/13/2023, 9:17 PM
You might not have closed or released
0.1.0
on the Nexus manager web interface
m

Marcus Cvjeticanin

03/13/2023, 9:24 PM
It worked great when adding that repository to my build file and changing to SNAPSHOT. Now I just have to figure out how to publish to deploy and promote. Where do I do that:
Or check that for that matter
I think I got it, I just wonder what is the purpose of close. Is that to avoid pushing artifacts to it because it's in a "release" state or ready for it?
k

Kirill Grouchnikov

03/13/2023, 9:43 PM
m

Marcus Cvjeticanin

03/13/2023, 10:39 PM
Fixed it. Thanks a lot for help!
4 Views