Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use static resource with maven jetty plugin

 
Nitesh Patel
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to develop simple web application with maven & jetty. So far everything was fine but when I tried include the static resource like images, javascript i come to an issue. How can we configure static resource into jetty plug-in so we can reference it. While searching on google I came across these tags webAppSourceDirectory & resourceBase but its not working. Below is my current jetty plug-in configuration,


I have my js files under /src/main/webapp/resoruces/js folder. Can anybody please guide me, how can I configure static resources ?

Regards,
Nitesh
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You did run a build, at least through the compile phase, right? Your JS files should then be at target/xxx/resources/js, where xxx is your artifact name.
 
Nitesh Patel
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
Thanks for the reply. Yes, during mvn jetty:run I can see my static resources (like JS, images) under target/XXX/resources/ location but somehow when I tried to access the same in respective JSP, it can not find them (sounds stupid but it is),



Regards,
Nitesh
 
Nitesh Patel
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Finally (somehow) i am able to resolve it using below configuration,


Thanks to all for your guidance/help.
Regards,
Nitesh Patel
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic