Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle build task doesn't add content of /src/main/webapp folder #180

Closed
fedotxxl opened this issue Dec 22, 2013 · 7 comments
Closed

gradle build task doesn't add content of /src/main/webapp folder #180

fedotxxl opened this issue Dec 22, 2013 · 7 comments
Milestone

Comments

@fedotxxl
Copy link

Hi.
I'm using spring-boot plugin 0.5.0.M6.
I've added static files to /src/main/webapp and configured run task similar to https://github.com/jaylindquist/spring-boot-service-and-static/blob/master/build.gradle

gradle run works as expected. gradle build builds flat jar file but it doesn't add content of /src/main/webapp folder. So java -jar xxx.jar will behave incorrectly

@dsyer
Copy link
Member

dsyer commented Dec 23, 2013

I'm not a gradler so I don't really understand the question, but I do know that the "build" task is not provided by Spring Boot, so you might be asking in the wrong place. If you have src/main/webapp aren't you building a WAR file (and don't you need a special task or plugin from gradle for that)?

@fedotxxl
Copy link
Author

No, I'm building jar that contains embed tomcat and application (if I understand it correctly)

@dsyer
Copy link
Member

dsyer commented Dec 24, 2013

Then why would you have src/main/webapp? I guess there's nothing to stop you doing that, but the standard build plugins use src/main/resources for adding resources to a JAR file, so if you want to do something different you have to configure the build tool in a non-standard way. Where you put stuff in src/main/resources is a function of what you want it to do at runtime, e.g. static resources can go in /static (or a bunch of other places), so it's not possible without more information to say what layout you need for your app. C.f. this sample.

@dsyer
Copy link
Member

dsyer commented Dec 24, 2013

If your resources are in src/main/webapp that suggests you are building a WAR archive. And for a JAR src/main/resources is more appropriate (eg in /static). It's up to you though if you want to put stuff in non standard places - you just have to configure the build system to understand what you mean.

@dsyer dsyer closed this as completed Dec 26, 2013
@JavierOrtuno
Copy link

JavierOrtuno commented May 27, 2016

How can I configure InternalResourceViewResolver to read my views from static folder?

@snicoll
Copy link
Member

snicoll commented May 27, 2016

@JavierOrtuno this issue is closed and questions are to be raised on StackOverflow. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants