Learning Maven, confused by dependency injection

First of all, I am a JS developer in the process of learning Maven when I move from the Rails house to the Java store. The people at Codehaus have been instrumental in providing the Maven archetype to guide people like me, in understanding how we can use Maven to manage dependencies in our code base:

http://mojo.codehaus.org/javascript-maven-tools/javascript-ria-archetype/index.html

Basically, I understand what they are doing now, but thereโ€™s one part that they donโ€™t explain, and I canโ€™t understand where the magic happens.

There is only one line in HTML in the index.html file of their sample RIA application to enable all JavaScript:

<script type="text/javascript" src="${index.js}"></script> 

When I run > mvn jetty:run on the command line, since they suggest running a test webapp, the value of ${index.js} is replaced with ALL JS files for the entire dependency tree that are needed for the application to work.

It's great, but I just don't know what part of the DO process. Can someone more familiar with this architecture explain this to me? Thank you very much!

+4
source share
1 answer

Dave Newton found me on the right track in his commentary on my question. The answer is described in the documentation:

http://mojo.codehaus.org/js-import-maven-plugin/usage.html

JS Import Maven Plugin , which has an artifactId from the javascript-maven-plugin under the extensions in the POM of the Codehaus RMA sample application, is responsible for the line #{index.js} specified in the index.html file, dropping the dependency tree starting from the index .js and automatically embed all dependencies in HTML. The exact mechanism used by the plugin to detect JS dependencies is described in the usage documentation above.

0
source

All Articles