Liferay's Blade CLI is an easy way for Liferay developers to create new Liferay modules. One of its features is to deploy modules, as described in the Deploying Modules with Blade CLI documentation. Unfortunately, at this time, Blade does not support deploying .war
files, though a new feature request has been created to notify the engineers of this request.
If you try to deploy .war
files with Blade, you'll see an error like this:
blade deploy
:assemble UP-TO-DATE :build :wars:my-spring-mvc-portlet-project:buildCSS Using native Sass compiler Parsed /css/main.scss in 577ms :wars:my-spring-mvc-portlet-project:compileJava :wars:my-spring-mvc-portlet-project:processResources :wars:my-spring-mvc-portlet-project:classes :wars:my-spring-mvc-portlet-project:war :wars:my-spring-mvc-portlet-project:assemble :wars:my-spring-mvc-portlet-project:build BUILD SUCCESSFUL Total time: 6.971 secs Error 0. [Jar.<init>] java.lang.IllegalArgumentException: A Jar can only accept a file or directory that exists: D:\Projects\NPL\test-blade-error\wars\my-spring-mvc-portlet-project\build\libs\my-spring-mvc-portlet-project.jar
Resolution
There are two workarounds:
- Copy the
.war
file manually into yourLiferay/deploy
folder - Install the
.war
using Gogo shell using the following example command:
blade sh install webbundle:${path to war}?Web-ContextPath=/${contextName}
An example of this would be:
blade sh install webbundle:D:\Projects\NPL\test-blade-error\wars\my-spring-mvc-portlet-project\build\libs\my-spring-mvc-portlet-project.war?Web-ContextPath=/my-spring-mvc-portlet-project
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