2

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.

1
  • I think this is good question but now project is already doing so, may be in new project. Also I guess native apnr is not available with such embedded tomcat? This can be on a separate thread instead of distracting from topic here. Isn't it? Commented Oct 21, 2013 at 18:33

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.