I have a project that has:
How can I organize this whole process in a sane, robust, and automated way?
What I have at the moment is Gulp and Maven, with Maven basically owning the whole process.
That kind of works, except for that Maven is generally very rigid and I feel I'm taking it too far. Using antrun to call Gulp is an ugly trick. It's very hard to control dependencies between these steps and monitor their outcomes. It's hard to control order of things in the same phase. Failsafe verify does not seem to process the external JUnit report files that Gulp generates. I could go on.
I wonder if I should do more in my build server (Jenkins), maybe using a build pipeline or parameterized triggers - but I've never done it and I'm not sure if that's really better.
So, how would you implement it?
In my experience, the frontend maven plugin is far and away the best plugin for this type of build/deploy process. https://github.com/eirslett/frontend-maven-plugin . This is how i use it for Grunt but it supports Gulp just as well.
<plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> <version>...</version> <!-- optional --> <configuration> <workingDirectory>src/main/frontend</workingDirectory> </configuration> <execution> <id>grunt build</id> <goals> <goal>grunt</goal> </goals> <!-- optional: the default phase is "generate-resources" --> <phase>generate-resources</phase> <configuration> <!-- optional: if not specified, it will run Grunt's default task (and you can remove this whole <configuration> section.) --> <arguments>build</arguments> </configuration> </execution> </plugin>
One thing to be aware of it is will download node for the system it is being run on, so if you have a different OS on your build server, you'll need to make sure that is the version you have checked into version control, your local version (for me OSX) will have to be maintained local to your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With