eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 868 forks source link

Create alternative nodejs download path #1110

Open Gasgeber opened 9 months ago

Gasgeber commented 9 months ago

Feature Request

Is Situation

The following download path is currently calculated:

https://nexus.mydomain.de/repository/npm-all/node/-/v18.16.1/node-v18.16.1-linux-x64.tar.gz (with manuel downloadroot) or https://nodejs.org/dist/v18.16.1/node-v18.16.1-linux-x64.tar.xz (with default downloadroot)

The path is hardcoded in Platform.java line 170

        return nodeVersion + "/" + getLongNodeFilename(nodeVersion, archiveOnWindows) + "." + os.getArchiveExtension();

Desired Situation

Our nexus offers the following download links:

For npm: https://nexus.mydomain.de/repository/npm-all/npm/-/npm-8.15.1.tgz (THIS WORKS) For node: https://nexus.mydomain.de/repository/npm-all/node/-/node-18.16.1.tgz (THIS DOES NOT WORK)

Could you please add the function to configure, so that the above node link may be generated so we can use our nexus repository?

Info: Unfortunately we can not change the files/paths in our nexus.

Thanks for any support

hazendaz commented 9 months ago

I second this. Nodejs ships both 'tar.gz' and 'tar.xz'. I rebundle for maven central. To preserve space on central, I'd like to eventually drop 'tar.gz' entirely. Rebundles here for reference. It would be nice to have ability to configure what extension type per platform in case it differs on any platform.

wkruse commented 8 months ago

Related to #413.

wkruse commented 8 months ago

A Raw Repository in Nexus that proxies https://nodejs.org/dist can be used. Then no changes in frontend-maven-plugin are required.

omarerc commented 6 months ago

I have this problem building guacamole-common-js that use this plugin but it is trying to download this Node Version https://nodejs.org/dist/v16.19.1/node-v16.19.1-linux-x86.tar.gz but this one isn't posted on the site.

[INFO] Downloading https://nodejs.org/dist/v16.19.1/node-v16.19.1-linux-x86.tar.gz to /root/.m2/repository/com/github/eirslett/node/16.19.1/node-16.19.1-linux-x86.tar.gz [INFO] No proxies configured [INFO] No proxy was configured, downloading directly [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 47.819 s [INFO] Finished at: 2023-12-30T17:49:07Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:install-node-and-npm (install-node-and-npm) on project guacamole-common-js: Could not download Node.js: Got error code 404 from the server. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:install-node-and-npm (install-node-and-npm) on project guacamole-common-js: Could not download Node.js: Got error code 404 from the server.

node

How can I modify the Path to Download the correct file?

eirslett commented 6 months ago

How can I modify the Path to Download the correct file?

I don't think Node.js has supported x86 on Linux for many years. Is it an option to switch to x64? Or you might have to compile your own custom Node.js binary. Maybe it's on https://unofficial-builds.nodejs.org/. You could use a "raw repository" in Nexus and then upload your custom Node.js binary in there, maybe.