This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to use static resource with maven jetty plugin

 
Ranch Hand
Posts: 33
  • 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
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • 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
  • 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
  • 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
    Bookmark Topic Watch Topic
  • New Topic