Tooling: Node.js Binary Download Maven Proxy


the current implementation of the nodejs-maven-plugin directly downloads the node.js binaries from the website, completely bypassing the maven artifact repository and thus caching of downloaded artifacts, proxy support etc.

the same applies to the frontend-maven-plugin, also this at least supports the maven HTTP proxy settings.

additionally we have some sporadic problems with download the binaries which seem to be related to corrupt download (WCMIO-57, ). a checksum check would help, but we would have to implement it ourselves.

and last but not least we directly depend on the availability of the website which may break our CI builds if it is down.

the proposed solution is to create a dynamic maven artifact repository proxy before the download area, which "transforms" it to maven artifact repository-like folder structure and dynamically generates a matching POM. thus the nodejs binaries can be referenced directly as maven dependencies with full control by maven and artifact managers like nexus and automatic support for local caching, checksums, proxy etc.

nothing will be cached by this proxy, it just dynamically routes through to the nodejs website, thus automaticall supporting all new version when the folder structure does not change. and if it is changing we can fix it in one central place. this is a better approach than e.g. where each new release has to be pushed manually to maven central.

it requires the user to include a custom additional maven repo url in his build, though.


Stefan Seifert
August 31, 2015, 11:20 PM

maven nodejs proxy implemented:

we'll see if we can make an instance of this proxy available under a public URL.

Stefan Seifert
March 11, 2015, 9:12 AM

once this is available we may create an issue on frontend-maven-plugin as well to make use of it, so we may have a migration path in the future to use it instead of our own nodejs maven plugin.

this dynamic maven proxy needs some mapping logic, so it is not possible to create it with an apache webserver alone using e.g. rewrite rules.
this would be a perfect match for a micro service container architecture like dropwizard or spring boot with a tiny service.





Stefan Seifert