Maven javascript tools
I'm googling as well, but I can't find out which one is the best or most common. JohnS There's no unified JS library dependency mechanism, let alone snippet mechanism, like there is for Java under Maven. I've used the JavaScript Maven Tools , but that's about it lately. Other stuff I've cobbled together. Show 1 more comment. Gili Gili WebJars are just zip files with all the static resources cleaned up.
I like it a lot but people continue to underestimate maven to resolve their client side dependencies. I have made my choice for WebJars. I have viewed few other options , but found WebJars most easy to start with.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. To start, let's add an index. As you can see above, the application uses Bootstrap to give us a nice interface, and has only two JavaScript dependencies: angular. The first one is AngularJS source code, which enables us to use the framework in our app, and the second one is the application that we will build.
Our AngularJS application will contain two files. The first one, which will be responsible for defining a new AngularJS module, will be called app - definition. This file will have the following code:. Usually this file would be used to define dependencies and to configure these dependencies behaviors.
But, as our application won't have any dependency, this file will be used only to define the new AngularJS module called app. The second file that our front-end application will have is the mainController controller used in the index. Let's call this new file as app - controller. As you can see, this controller has three functions. One to add new tasks, one to remove a task passed as parameter, and one to load all tasks from the RESTful application.
Now we just need to assemble these files in a single one, called app. To process the AngularJS source files created above we will use Gulp. But first, let's define our application as a Node. To do that, let's issue the following command in the root directory of our application:. This will add a file called package. After that, we can install Gulp and its plugins:.
And then define a new file called gulpfile. This file contains two tasks. And the second one is responsible for processing the AngularJS source files created before, assembling it as a single one called app. This task also checks if it is running on production to decide if it should uglify the JavaScript source code or not. Uglifying JavaScript code is a good technique, but can make debugging harder. Therefore, we use this plugin only when releasing our code to production.
It is well documented, it just works. Refer to the Usage page and the parameters of yuicompressor:compress for precise configuration. The best and the most advanced one I found till today is wro4j. The idea for the library and the Maven plugin is different from everything I was able to find on the internet, combining pretty much every tool available into one standalone library.
You have two modes with wro4j available - first is to operate dynamically as a filter in Java application, second is to use build-time solution with Maven plugin. It's all really straightforward and well explained on the project documentation section , so take a look and dive deep. There are fully operational and well explained examples on how to integrate wro4j with one's application or with Maven build process. You can look at cactus maven plugin. How are we doing? Please help us improve Stack Overflow.
Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Javascript-Maven-Tools has been initially build and tested on Maven2 and should work on any Maven2 compatible platform.
It is now actively developed using Maven3. A maven documentation site is available. This project is a fork of the original project hosted at codehaus which seems to be abandoned since a while, and has never reach a release version. Skip to content. Star 4. Maven extensions and plug-ins for Javascript - Fork of original project from codehaus 4 stars 1 fork.