anyone have any debugging tips as to why intellij ...
# intellij
m
anyone have any debugging tips as to why intellij wouldn’t be downloading the sources for my dependency? it’s my own kotlin library i’ve uploaded to our internal artifactory. all the source files appear to be there in a sources jar, and intellij’s gradle is able to resolve and download the dependency, but when i go to actually import the functions it can’t resolve the symbols
i’m super new to kotlin/gradle in general. do i have to do something special in the library’s generated pom.xml file? i can see the sources in our package repository, but can confirm in the gradle caches that they’re not being downloaded
s
have you specified your artifactory as a server in your settings.xml?
m
Hmm, which are you using? Maven or gradle? If maven, then nothing would appear in gradle cache, right?
v
This issue is there for as long as i can remember using intellij, i even opened tickets for these. Its a common sense that if someone tries to see the sources of the dependency you would go and try to find that sources jar even if no special config is set.
m
My experience has always been that intellij will show the source if it's already downloaded, or decompile and have a button/selection at top of tab to download sources. I believe there's an option to tell it to automatically download sources. But now we're completely off topic for this channel as this is for the kotlin intellij plugin only, and not for intellij support.
r
My experience has always been that it’s completely random, IntelliJ sometimes has the sources already, and sometimes it doesn’t, shows the “Download sources” button, which doesn’t work either. Doing a full clear would change which library sources are available randomly. No difference between Maven and Gradle.
m
i’m using gradle. i can find the downloaded library in
~/.gradle/caches/modules-2/files-2.1/
under the proper group/artifact directory structure, but there are no source files, just a
.pom
file
and yes, i’ve properly specified the artifactory server. i’m using gradle, so this goes in the
repositories {}
block. but it can resolve and sync the library just fine
so, dumb but maybe kotlin-related followup question, to get us back on track for this channel: what’s the alternative for my library to providing a source jar? is there a good example of how to build a kotlin/native library that’s easy to install?
s
Wait you said
i’m super new to kotlin/maven in general
though. So are you using gradle or maven?
m
sorry, i meant gradle
i mean, i’m new to maven, too, but that’s not the issue 🙂
s
ok. so you're using gradle. that means you could try using
--refresh-dependencies
if stuff isn't being picked up.
👍 1