Reputation: 2094
I am looking to front apache http server infront of tomcat 7, to render my static contents for better performance and scalability.
Now using pom, I was able to deploy to tomcat complete war.
But I could not find any plugin which will start http server and deploy static content to it.
Basically I looking to filter static resources and deploy it to http server while dynamic contents in the form of .war file to tomcat.
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/</path>
<keystoreFile>../classes/.keystore</keystoreFile>
<keystorePass>someSecret</keystorePass>
<httpsPort>8443</httpsPort>
<ajpPort>8009</ajpPort>
</configuration>
</plugin>
I looking for something similar with embedded apache http server plugin or stuff.
Well other reason to redeploy on the fly is the static resources has a build based key, which will help to invalidate client side cache on every new build.
Some other solution which I already have is point my static resource folder inside tomcat webapp thru apache htaccess file as root and use it, but I have to manually change the static folder name every time new build is generated in this case.
Upvotes: 2
Views: 2133
Reputation: 856
A possible solution could be to use maven-antrun-plugin. You could define an Ant task that copy the static resources in the remote http server and bind it to the deploy phase of the maven lifecycle.
Upvotes: 1