Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Trying to download from lax.liferay.com
Hello Liferay-Devs,
our Liferay-Build (done with GitLabCI) suddenly failed.
Are there any problems with mirrors.lax.liferay.com or anyone else having the same problems lately?
Greetings,Fredi
our Liferay-Build (done with GitLabCI) suddenly failed.
Are there any problems with mirrors.lax.liferay.com or anyone else having the same problems lately?
Greetings,Fredi
> Task :downloadNode FAILED
Trying to download http://mirrors.lax.liferay.com/nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz to /root/.liferay/mirrors/nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz.tmp
Trying to download http://nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz to /root/.liferay/mirrors/nodejs.org/dist/v8.10.0/node-v8.10.0-linux-x64.tar.gz.tmp
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':downloadNode'.
> Redirection detected from http to https. Protocol switch unsafe, not allowed.
nodejs.org redirects to https nowadays. Why this should be unsafe is truly a mystery to me. Anyway, you need to set the nodeUrl in build.gradle to work around the issue.
node.nodeUrl = "https://nodejs.org/dist/v${node.nodeVersion}/node-v${node.nodeVersion}-linux-x64.tar.gz"
node.nodeUrl = "https://nodejs.org/dist/v${node.nodeVersion}/node-v${node.nodeVersion}-linux-x64.tar.gz"
Thank You Christoph,
that truly is a mystery.
With your help I was able to fix the issue by setting this in the module-build.gradle.
While searching through the Liferay Documentation I also came across this page: https://help.liferay.com/hc/en-us/articles/360017890812-Node-Gradle-Plugin
Question 1: Would you recommend to set your setting in:
- project-wide build.gradle or
- module-only build.gradle?
Question 2: I realized that we don't have such Node Gradle Plugin buildScript (shown in linked Article) in our projects.
Would you recommend to include this? And if yes, where would you place it?
To set your solution node.nodeUrl to the https-URL worked for us even that we dont have such Node Gradle Plugin in our Gradle Files.
Where is this coming from? Why is the node-Property even available?
Feeling like our projects missed some important stuff for a long time. Would be great if you could bring some light into this (for me) dark hole Christoph.
Cheers,
Fredi.
that truly is a mystery.
With your help I was able to fix the issue by setting this in the module-build.gradle.
While searching through the Liferay Documentation I also came across this page: https://help.liferay.com/hc/en-us/articles/360017890812-Node-Gradle-Plugin
Question 1: Would you recommend to set your setting in:
- project-wide build.gradle or
- module-only build.gradle?
Question 2: I realized that we don't have such Node Gradle Plugin buildScript (shown in linked Article) in our projects.
Would you recommend to include this? And if yes, where would you place it?
To set your solution node.nodeUrl to the https-URL worked for us even that we dont have such Node Gradle Plugin in our Gradle Files.
Where is this coming from? Why is the node-Property even available?
Feeling like our projects missed some important stuff for a long time. Would be great if you could bring some light into this (for me) dark hole Christoph.
Cheers,
Fredi.
The Liferay workspace adds A LOT of magic and hidden dependencies, maybe even the node plugin nowadays. I honestly don't know.
Please note that you are not working with plain Gradle here, you are working in the Liferay environment on top of Gradle. Liferay changed a lot and added a lot of convenience for developers. Those plugins do many, many things. I have looked a couple of times into the Liferay Gradle plugin code to understand what it does and how I can work around some things that happen. We had several issues here before, things that happened only on some Windows machines, things that suddenly broke because some dependency was updated by Liferay, ...
Things like that happen, but the magic is worth it. You write some code and "magically" a jar file with a nice bnd file appears.
1) If the node variable is available in the project-wide build script, you can certainly add it there. Maybe add a comment, if you upgrade the build to a newer workspace version, to check if it is still needed. If you prefer it in the module, it is fine too. You just need to remember the error and when another module fails, add the setting. That's what we do, we have certainly 50 or more Liferay projects in git, per customer, several "toolbox projects", ... and so we have no "global" setting.
2) If you don't need it, don't add it. Please note that the theme uses node, some other modules (Fragments?) could need it too. It might be an implicit requirement. It is hard to tell without seeing your whole project, workspace versions, module types, build.gradle files, ...
In general: If you develop frontend modules, node is often useful. It makes tons of useful modules for the frontend (React, Vue, sliders, trees, ..,.) availabel AND adds several build related modules that allow you to transpile your javascript and css. It allows you to write nicer code which is then tranformed to really ugly code that all browsers understand.
We use it heavily, most of our applications are nowadays JS + Rest modules.
Please note that you are not working with plain Gradle here, you are working in the Liferay environment on top of Gradle. Liferay changed a lot and added a lot of convenience for developers. Those plugins do many, many things. I have looked a couple of times into the Liferay Gradle plugin code to understand what it does and how I can work around some things that happen. We had several issues here before, things that happened only on some Windows machines, things that suddenly broke because some dependency was updated by Liferay, ...
Things like that happen, but the magic is worth it. You write some code and "magically" a jar file with a nice bnd file appears.
1) If the node variable is available in the project-wide build script, you can certainly add it there. Maybe add a comment, if you upgrade the build to a newer workspace version, to check if it is still needed. If you prefer it in the module, it is fine too. You just need to remember the error and when another module fails, add the setting. That's what we do, we have certainly 50 or more Liferay projects in git, per customer, several "toolbox projects", ... and so we have no "global" setting.
2) If you don't need it, don't add it. Please note that the theme uses node, some other modules (Fragments?) could need it too. It might be an implicit requirement. It is hard to tell without seeing your whole project, workspace versions, module types, build.gradle files, ...
In general: If you develop frontend modules, node is often useful. It makes tons of useful modules for the frontend (React, Vue, sliders, trees, ..,.) availabel AND adds several build related modules that allow you to transpile your javascript and css. It allows you to write nicer code which is then tranformed to really ugly code that all browsers understand.
We use it heavily, most of our applications are nowadays JS + Rest modules.
Thanks Christoph for your insights!
Yes, I might have read something similar from you in the past and I am also trying to mainly use JS + REST Modules.
Maybe a little offtopic but regarding REST:
When using REST-Modules are you using the Liferay REST-Modules? ( New > Liferay Module Project > Project Template: rest) or are you using something different maybe even Spring?
And are you making use of import javax.ws.rs?
Cheers,Fredi
Yes, I might have read something similar from you in the past and I am also trying to mainly use JS + REST Modules.
Maybe a little offtopic but regarding REST:
When using REST-Modules are you using the Liferay REST-Modules? ( New > Liferay Module Project > Project Template: rest) or are you using something different maybe even Spring?
And are you making use of import javax.ws.rs?
Cheers,Fredi
We are using the Liferay rest modules, the Whiteboard version (the default in 7.1+). And yes, we import javax.ws.rs. We have added some convenience code, e.g. custom context modules for users and permission checks.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™