Issue
- How to build the Gradle workspace without an internet connection?
- Steps to run the gradlew command using offline mode
Environment
- Liferay DXP
Resolution
- We have improved the offline support in the most recent release of the DevStudio, however, all of our build tools (Gradle or Maven)) require an internet connection to download the dependencies. Hence, the Liferay workspace build will not work offline.
- For debugging purposes, the below attributes help when executing the Gradle tasks to see is there any additional log information getting traced. For example:
- --stacktrace (or even --full-stacktrace) and
- --info (or --debug)
- --offline
Note: with the third one, you’re asking Gradle to not use the Internet at all. But not sure if the Liferay Plugins respect that or not.
-
Secondly, the workspace plugin tries to fetch
https://releases.liferay.com/tools/workspace/.product_info.json
with every run of a Gradle build. This might happens when registering theliferayWorkspace
extension on theSettings
object:
-
You might be able to get around this by putting the file into the
_workspaceCacheDir
([user.home]/.liferay/workspace
) -
And, unless the code fetching the URL (DownloadCommand -> HttpUtil) always executes a HEAD request to the given URL to get the Last-Modified header and compare it to the locally cached file.Unfortunately, it seems it does do exactly that, every time:
Additional Information
Please Note: The stated procedures and unofficial link involve custom environmental ideas that are beyond the scope of Liferay Support. Please exercise appropriate discretion in the use of this information. For further assistance on the implementation ideas from Liferay, please reach out to our dedicated global service team. Your sales representative is a great resource to discover the connectivity with the GS team to know more about it in detail.
- The below unofficial information might help to understand or plan what actions may take to run Gradle build without an internet connection whereas "completely offline build" is not something we support.
Contenido exclusivo para suscriptores.
Una Suscripción Enterprise de Liferay proporciona acceso a más de 1.500 artículos que incluyen las mejores practicas, diagnóstico de problemas y otras soluciones útiles. Inicia sesión para tener un acceso completo.
Inicia sesión