Note that there are some explanatory texts on larger screens.

plurals
  1. POExternalizing static content from a WAR and serve both on jetty
    primarykey
    data
    text
    <p>In my project I use Maven to package a web application to a WAR which is later deployed to Jetty using a custom Maven plugin on CentOS. The custom plugin is used by every project that deployes to a production environment. There is now a requirement that all static content (like web site text, properties) is packed outside of the WAR so that it can be changed in production without requiring a new release cycle. I am unsure how to achieve this externalization. </p> <p>The Jetty server has the directory structure described in <a href="http://www.eclipse.org/jetty/documentation/current/quick-start-getting-started.html" rel="nofollow">Jetty quick start guide</a>. Currently, the web application already offers <em>some</em> <code>.properties</code> files which can be altered externally, and these reside in the <code>resources/</code> directory. These files are moved here by the custom Maven plugin. The WAR resides in the <code>webapp/</code> folder. One option for my problem is to use <code>&lt;packagingExcludes&gt;</code> of <code>maven-war-plugin</code> to not include e.g. <code>*.xhtml</code> and <code>*.properties</code> in the WAR. Later, I can use the custom Maven plugin to move excluded files to <code>resources/</code> directory. But, I have a feeling this is not the correct way to externalize static content... Shouldn't xhtml files live in <code>webapp/</code> folder while the only the properties file live in <code>resources/</code> folder?</p> <p>I have also researched the option of deploying the WAR as exploded, but I am unsure of the implications of such. Clearly, the changes in the exploded WAR files will be overwritten in the next deploy, but the idea is to do static changes both in development and production. Also, I am not sure how to achieve WAR "explosion", is it something that Jetty does for your WAR if configured in <code>jetty.xml</code> or do I have to extract the WAR before deploying?</p> <p>Lastly, how do people serve static content in Jetty which can be altered in production? Do both the WAR and static files live side by side</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload