https://kotlinlang.org logo
#announcements
Title
# announcements
c

corneil

08/18/2019, 5:53 PM
You should use "img/name.png"
g

Gunslingor

08/18/2019, 8:57 PM
yeah, doesn't seem to work. There doesn't appear to be any in images in the build folder.
c

corneil

08/18/2019, 8:59 PM
build/resources/main
?
g

Gunslingor

08/18/2019, 9:00 PM
there is no resources forlder in build/main
build
c

corneil

08/18/2019, 9:01 PM
If you want WebMVC to serve images you need to place them in
src/main/resources/static
g

Gunslingor

08/18/2019, 9:01 PM
ok, can I have subpathing in that?
static/logos? example
c

corneil

08/18/2019, 9:02 PM
WebMVC will automatically serve static content from there.
g

Gunslingor

08/18/2019, 9:02 PM
hmm, interesting... i was kinda planning to use angular cli for the from end.
c

corneil

08/18/2019, 9:03 PM
If you want to access Resources using ClasspathResource then classpath is relative to
src/main/resources
and
src/test/resources
g

Gunslingor

08/18/2019, 9:04 PM
Is there another method? serving up images used to be the easiest thing in the world, seems harder and more presumptuous in this environment 😃
Yeah, something isn't right. my gradle task processResources says NO-SOURCE even after changing to thte expect folder hierarchy
Trying to add it here without luck: sourceSets["main"].withConvention(KotlinSourceSet::class) { kotlin.srcDir("src/serverMain/kotlin") resources.srcDir("src/serverMain/resources") } sourceSets["test"].withConvention(KotlinSourceSet::class) { kotlin.srcDir("src/serverTest/kotlin") resources.srcDir("src/serverTest/resources") }
Solved it with this. gradle syntax is confusing.
Tried these but didn't work
2 Views