Run Gulp and Redploy in IntelliJ - maven

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]]

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?

Related

cannot access to /q/dev on quarkus from an uber-jar despite being in dev

I recently start deploying my quarkus project utilising a jar build by uber-jar
now each time I try to acces to /q/dev or anything like that, I have this error :
RESTEASY003210: Could not find resource for full path: http://participeo-monchoixdevie-api-dev.emotic.fr/q/dev/
Any idea?
I'm running in profil dev.
Running in dev-mode and running from an uber-jar are mutually exclusive. If you're running an uber-jar, you are not in dev mode, and so the dev mode facilities are unavailable. Perhaps you mean that you compiled the uber-jar with quarkus.profile=dev, but that is a bad idea to do (it will probably only affect the set of used configuration values, but won't activate dev mode). Dev mode is what you get by executing mvn quarkus:dev on the project (or an equivalent if you're using Gradle).

Node.js: re-run cucumberjs tests automatically on each source file change

What is the simplest way to tell cucumberjs to watch for source project files changes so that it can re-runs its tests?
You could add a gulp task. Here is more information on how gulp works https://gulpjs.com/docs/en/api/concepts

How can I run a lineman project in Jenkins so the protractor tests can find the browser?

I have a project which is setup with lineman and uses maven for build configurations. A maven pom.xml file is used to configure the jenkins builds. This file lists the necessary tasks that need to be done in order to build the project. The lineman tasks are specified here as well. The command lineman grunt spec-e2e starts the protractor tests.
This currently works on the jenkins server because it starts the webdriver and runs the tests. However, all specs in the tests fail since browser.get('myurl') can't find anything since nothing is running. I tried to add lineman run as a task but this causes the jenkins-build to get stuck on the watch task.
How can I get the project to run and therefore make it accessible for the protractor tests?

problems running state machine examples

Congratulations on the spring state machine, I found it yesterday and have been trying it out, specifically the turnstile example running in STS. I found it very easy and intuitive to build a FSM.
Because spring shell doesn't work well in STS I tracked down the instructions to run the examples from the command line in the reference doc,
"java -jar
spring-statemachine-samples-turnstile-1.0.0.BUILD-SNAPSHOT.jar"
,
but running it got an error
"no main manifest attribute, in spring-statemachine-samples-turnstile-1.0.0.BUILD-SNAPSHOT.jar".
Although not even a novice in using gradle, I tried fixing this by adding this line to build.gradle in the jar section
"manifest.attributes['Main-Class'] = 'demo.turnstile.Application'"
(which doesn't handle the various sub-projects I know) but got this error
"NoClassDefFoundError: org/springframework/shell/Bootstrap".
If it is possible to run the samples from gradle, could you include them in the reference document? I tried running the samples using
gradle run
but it there was no interaction with the shell scripts.
Samples are designed to be run as executable jar and with shell so that you can interact without a need to recompile with every change. Your error indicates that you didn't build that sample jar as mentioned in docs.
./gradlew clean build -x test
This will automatically use spring boot plugin which will add the necessary jar manifest headers to jar meta info to make it a true executable jar. Essentially every every sample is a spring boot app.
Building SM sample projects in Windows Environment:
Open Command prompt (windows key + r -->cmd-->Enter), Change directory to project root folder spring-statemachine-master (Inside the Extracted folder).
Run gradlew install to get all spring dependencies copied to local machine.
Run gradlew clean build -x test to get the spring shell jars built. Courtesy Janne
These steps should ideally get all .jar built, look into \build\libs folder of respective sample project for jar files.
Run the like any other java jar file java -jar [jar-file-name.jar] (make sure to be change directory to jar file directory location).
One more thing where I was stuck was, How to give events to SM:
It's like this sm event EVENT_NAME_AS_DEFINED_IN_CLASS. Ref
E.g.: sm event RINSE --> to washer project

How to avoid unneeded recompilation from IntelliJ Idea 13 when it runs a maven vaadin project created in the command line

I have created a maven vaadin project using the command line like this:
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.1.9
Then I change into the folder of the application and I give at the command line the following :
mvn install
After waiting for the application to compile, I open it using IntelliJ Idea (by opening the pom.xml file), I add Tomcat Server and I press run.
Then the IntelliJ Ide recompiles the application again.
Is there any way I can avoid this second compilation?
Thank you.
You should have tomcat configured as a server, and configure your module(s) to deploy at server startup. On the run configuration you will see a list of things to do before launch. It will probably say Make -- you can remove this if you need to.
However, you probably should allow idea to do this for you and really stop doing it on the command line. Idea can handle more complex build patterns for you. You should trust it.

Resources