2

I'm trying to figure out how after a quick edit of say a .less file or an .html file or a .js file that I can quickly see the changes in the web application running Tomcat being served from IntelliJ.

We've wired Eirslett's frontend-maven-plugin into our project to run Gulp to generate the CSS from the LESS files and other tasks like JS minifying.

The only thing that I know works is to go to the command line and execute mvn clean install from the command line and then re-run the IntelliJ Tomcat configuration.

The problem is this takes many minutes with our build. Seems like there must be some trick where I can tell IntelliJ to just re-run Gulp and then redeploy the CSS, JS and HTML changes without re-compiling all the Java and restarting all my services and other gunk.

I know that if I'm just making changes to HTML or JS or CSS in a simple java web application that doesn't use Gulp that I can issue the 'Build, Compile' (CommandShiftF9) command on the affected files in IntelliJ and IntelliJ will re-deploy those selected files. I'm looking for something like that but that also runs Gulp before redeploying.

I've running Gulp from command line and seeing if IntelliJ would pick up the changes, but instead the Tomcat running in IntelliJ crashes with a bunch of these

23-Nov-2015 12:28:53.518 SEVERE [localhost-startStop-2] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying configuration descriptor /Users/jkirby/Library/Caches/IntelliJIdea15/tomcat/app1,_app2,_app3,_app4,_app5,_app6_(1)_cumulus/conf/Catalina/localhost/site.xml
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/site]]
Kirby
  • 15,127
  • 10
  • 89
  • 104

1 Answers1

2

Use Gulp watch instead of making Intellij run custom scripts on redeploy. As far as I can tell, it is not possible to run custom scripts when re deploying (CommandShiftF9)

If you want to give it a try, here is a related SO article on how to set it up: How to Gulp-Watch Multiple files?

Community
  • 1
  • 1
Per Eriksson
  • 524
  • 1
  • 9
  • 25
  • 1
    Thanks. Yeah, that gets me part of the way there. It at least cuts down the down time from minutes to seconds, which means that much more time to be coding instead of drinking cofffee ;) – Kirby Nov 24 '15 at 17:03