I'm upgrading Apache Roller, a Java-based web application, from YUI2 to YUI3. We're not using Yahoo's non-SSL CDN here because Roller sometimes runs on SSL and we'd like to avoid browser popup warnings to the user about non-SSL sites being accessed. That means we would need to embed the YUI3 libraries with our project, as we did earlier with the much smaller YUI2. The problem is that YUI3 has a ton of folders (about 375 total), one for each component or component dependency. I've used the YUI Configurator to identify and import "only" the 75 that we need, but still, this is very messy in our project file system, adding 75 folders with most just having one needed file.
Is there a more efficient way to embed YUI3? It would be nice if I could put the 75 "-min.js" files all in one folder instead of one folder apiece, but I'm not sure that YUI3's dependency discovery system would work if I did that. Something like JQueryUI's Custom Builder where I choose the components I want and have to add only a single file, or just a few files to source control would be ideal. We already use JQueryUI for some items, we may need to use it more if incorporating YUI3 can't be less burdensome on the file system.
We've done exactly this in our large Java Web-App. First step was to create a new Maven artifact called YUI. It just contains the whole of a YUI release. We have an in-house maven repo to publish it to, but if you're not using Maven, you can just put YUI into a jar file and include it into your project.
We place the files into /META-INF/resources/yui in the JAR, as this path will be made web-visible in Servlet 3.0 compliant containers such as Tomcat.
It's worth looking at the WebJars project, which packages a large number of JS frameworks. The version of YUI it hosts is out of date, but you might be able to give them a nudge to update it.
That'll allow you to configure YUI to pick the files up from this new location (use the 'base' attribute described in the loader documentation)
At this point, you'll no longer be relying on the CDN, so you can host over SSL just fine, which I think meets the requirements of the question. The downside is that you'll be loading individual files, rather than using YUI's combo loader.
What we did was to write a combo loader Servlet, which is capable of taking a YUI combo request and serving the requested module concatenated together. If the YUI files are inside a JAR, you'll need to get them from there, but it's fairly straightforward to do.
The only caveat to writing your own Combo Loader to host YUI is hosting the gallery. Recent builds of the gallery have hardcoded links to images in their CSS which point to their CDN. which will cause problems hosting over SSL. If you're not using the gallery, it's all good.