Tomcat WAR deploy In Place

I have a project that uses Spring, Maven and I'm debugging it in IntelliJ.

I have an main/html folder which I map to /.

I currently run it as an exploded war that is packaged into the war directory.

Everytime I edit a js or html file in the main/html folder, I need to redeploy to see the changes.

Is it possible to deploy 'in place' such that for these static files, It doesn't need to do a copy and restart the server?

Perhaps I need to change my project directory structure a bit??

5 comments
Comment actions Permalink

You can use 'Update Running App' action (Ctrl+F10) to quickly reload changed resources without redeployment.

I have a project that uses Spring, Maven and I'm debugging it in IntelliJ.

I have an main/html folder which I map to /.

I currently run it as an exploded war that is packaged into the war directory.

Everytime I edit a js or html file in the main/html folder, I need to redeploy to see the changes.

Is it possible to deploy 'in place' such that for these static files, It doesn't need to do a copy and restart the server?

Perhaps I need to change my project directory structure a bit??

---
Original message URL: http://www.jetbrains.net/devnet/message/5250424#5250424



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

This causes the web server to restart though, which is unecessary when I've only changed static files.

0
Comment actions Permalink

You could use the Maven Jetty plugin to be able to run/debug your app
with an Idea Maven Run configuration.
If you use the goal jetty:run instead of jetty:run-exploded, it just
does what you need. That's how I am working even though we in the end
deploy on Tomcat.

If you insist/need to work with Tomcat, there's also a Maven Tomcat
plugin that you can run with an Idea run config.
I'm less famililar so you'll have to explore
http://mojo.codehaus.org/tomcat-maven-plugin/
It's pretty good and flexible as far as I've used it.

But nothing beats Jetty's plugin simplicity and ease of use IMHO.

On 2009-11-20 07:27:13 +0900, sal wa <no_reply@jetbrains.com> said:

This causes the web server to restart though, which is unecessary when
I've only changed static files.

---
Original message URL: http://www.jetbrains.net/devnet/message/5250483#5250483



0
Comment actions Permalink

nodje wrote:

If you insist/need to work with Tomcat, there's also a Maven Tomcat
plugin that you can run with an Idea run config.
I'm less famililar so you'll have to explore
http://mojo.codehaus.org/tomcat-maven-plugin/
It's pretty good and flexible as far as I've used it.

But nothing beats Jetty's plugin simplicity and ease of use IMHO.


The tomcat plugin works exactly the same as the jetty plugin. Run 'mvn tomcat:run' and you have a running app with js, css, jsp etc loaded directly from your sourcefiles. Change files in IDEA and reload browser

Example config:

               <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tomcat-maven-plugin</artifactId>
                    <version>1.0-beta-1</version>
                    <configuration>
                         <path>/mypath</path>
                    </configuration>
               </plugin>


The jetty plugin also have option to scan for changed class files and reload the whole application, I don't think the tomcat plugin can do that yet. But when it comes to static files they are equal.

0
Comment actions Permalink

No it doesn't (or at least it shouldn't and it doesn't cause a restart for me).
You can choose between "Update Resources" and "Redeploy" and only the latter should cause a restart.

But I never used that anyway. You can choose to "package" a file (right click in editor)
which will copy the file to the exploded dir where tomcat will pick it up.
If you "make" the project all files are packaged to the project. In IDEA 9 for this to work you
need to have the exploded artifact configured to "Build on make".
Alternatvely you can invoke main menu Build->Build Artifacts->Your exploded artifact to have
all files updated.

sal wa wrote:

This causes the web server to restart though, which is unecessary when I've only changed static files.

---
Original message URL: http://www.jetbrains.net/devnet/message/5250483#5250483

0

Please sign in to leave a comment.