aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to use static resource with maven jetty plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to use static resource with maven jetty plugin" Watch "How to use static resource with maven jetty plugin" New topic
Author

How to use static resource with maven jetty plugin

Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
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

Joined: May 14, 2008
Posts: 5845
    
    7

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.


JBoss In Action
Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
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

Joined: Mar 16, 2008
Posts: 33
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
 
subject: How to use static resource with maven jetty plugin