Skip to content

serveStatic - does not find resources from Jar. #24

@ThraaxSession

Description

@ThraaxSession

Hi @danneu

I've got following snippet:

val public = this::class.java.getResource("/public").path
val static =  serveStatic(public, maxAge = Duration.ofDays(365))

When I run it directly in gradle with ./gradlew run ... it works and I can gather the static files
But when I build a fat Jar and run it, it doesn't work.
Then I get this error:

WARN [serveStatic] Could not find public resource folder: "file:/home/gino/Programming/myapp/build/libs/myapp-SNAPSHOT.jar!/public". serveStatic skipped...

After unzipping the Jar, I can see that my public folder is there.

Do you have any ideas?

Thanks and best regards
Gino

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions