Javascript Dependency System using Maven + YUI Loader

I started thinking a while back about how to create a repository of Javascript libraries / applications using Maven for decentralized transitive dependency management. The progression of things that has led to these thoughts are Maven, Maven JS Tools (feature request), Google AJAX Libraries API, and YUI Loader.

My initial thoughts include using the Maven JS Tools plugin to build Javascript libraries in the same fashion as library jars for Java. These can be pushed to an external Maven repository and synced with the central repository.

A daemon could then pull Javascript artifacts from the central repository and process them. This would include extraction, building dependency meta-data for YUI Loader so that it could discover dependencies and download them as needed, and making both items available on a public HTTP server using YUI Loader's layout conventions.

On the client side, there would exist a MavenLoader model as a module loaded YUI Loader as normal. It would use addModule() like:
loader.addModule({
name: "mavenloader",
type: "js",
fullpath: "http://jsrepo.maven.apache.org/mavenloader/mavenloader.js"
});

// pull in the mavenLoader module now
loader.insert();

From this point, you could create a new MavenLoader as a decorator for YUILoader:

//Add the module to YUILoader
var mavenLoader = new MavenLoader({
loader: loader,
// maybe this can be inferred based on the loaded mavenloader?
repopath: "http://jsrepo.maven.apache.org/"
});

mavenLoader.require( "com.soashable:xmpp4js:1.0-SNAPSHOT" );
// or
mavenLoader.require({
groupId: "com.soashable",
artifactId: "xmpp4js",
version: "1.0-SNAPSHOT"
});
The meta-data that the repo adds to the Javascript artifacts would call register() and addModule() just like regular yui modules work, except it would be on MavenLoader and actually wrap the YUI Loader functionality under the hood:
mavenLoader.addModule({
groupId: "com.soashable",
artifactId: "xmpp4js",
version: "1.0-SNAPSHOT",
requires: [{groupId: "com.prototype", artifactId: "prototype", version: "1.5.1"}]
});

// ...

MavenLoader.register({
groupId: "com.soashable",
artifactId: "xmpp4js",
version: "1.0-SNAPSHOT"
}, YAHOO.xmpp4js.Module);

At this point, a call to the normal YUI Loader's insert() method should pull in all Maven dependencies transitively, with tranitive modules being added, registered and included recursively.

This is of course rough speculation, but my initial experimentation leads me to belieive that this system should be possible.