Spring boot app not loading resources when run as artifact

Answered

I have a simple web page that I bought from a template site that I have got running via Spring Boot
This all runs fine when run from within IntelliJ
I tried to assemble this as an artifact as i want to run this as a fat jar on AWS EC2 but when I run this as an artifact I see the html but it is missing the images and JavaScript

Any idea what I need to do to make this work as an artifact?

0
6 comments

If I try the solution in the Stack Overflow post it says the manifest already exists in VFS, which it doesn't because I deleted it first

 

0
Avatar
Yaroslav Bedrov

When do you get manifest error?

0

It only seems to do that if i had a previous manifest 

I created a new project and then tried what that stack overflow site said and it had no effect

To be honest the whole process of creating an artifact is complete shit.

Its overcomplicated, It should be a one click process and it should create a jar with all your classes, all your resources and all the dependencies and just create the jar

The current process is overcomplicated and if you miss out a single stage it all just fails

I have a 2 page evernote doc on this because the process is so error prone and this works great for when i want to make my microservice a jar with no static resources, but i wanted to build a quick web site with some static resources and i incorrectly assumed this would be a simple addition to say add resources to the jar but it doesnt work

As i said, this should be a one click add everything, not the nonsense you currently have

0

I sorted the problem of hosting a static web site in about 5 minutes with nginx so you can consider this issue closed.

It was probably overkill using Spring Boot to host a static site but i thought it would be a lot easier than it is

If you can consider my feedback on how annoying it currently is to create self contained artifacts in future release of IntelliJ that would appreciated

0
Avatar
Yaroslav Bedrov

Thanks for information!

Feel  free to create request on YouTrack for "Spring Boot Jar" artifact feature: http://youtrack.jetbrains.com/issues/IDEA. So developers and other users could discuss it and share suggestions.

0

Please sign in to leave a comment.