- “You can use it to focus(). Big deal.”
You no longer need too, as we have JsUnit, and other tools.
Dependencies are dependencies
One of the problems with Java web applications, is that you can often do a search for files on a developers hard drive, and see MANY of the same files.
For example, you search for struts.jar, and there are 23 instances of it on the file system. Of course, they are not all the same size, since they are various versions (but you don’t know).
Now, we can define our project dependencies, and the correct versions are tracked, and downloaded automatically. Very nice.
WEB-INF/lib == /scripts
Maven JS type
Maven has the base framework that we need to make this quite trivial. First, we can just agree on the ‘type’ of dependency. I am using js. Then you can just add dependencies as per normal:
<dependency> <groupId>adigio</groupId> <artifactId>xhr-test</artifactId> <version>0.1</version> <type>js</type> </dependency>
This means that maven will try to grab:
or in the example above:
from the various repositories that you have setup in your
NOTE: ‘[type]s’ is hard-coded. There is no way to map “when you see type ‘js’ look in directory ’scripts’, or something like that. This means that ‘jss’ looks a lil’ silly :).
Rather than writing some manual goals to handle this, I wrote a Maven plugin which piggy-backs on the war plugin.
However, although you have a goal in which you can kick off this task, in practice you don’t need to use it. The plugin registers itself with the war module, and whenever it is invoked, it sneaks in and does the copy. So, it is a seemless introduction!
To download and install the plugin, you can simply:
- Add: http://www.adigio.com/maven to maven.repo.remote