Legacy Knowledge Base
Published Jul. 2, 2025

Blade Deploy Does Not Support WAR Files

Written By

Christopher Lui

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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:

  1. Copy the .war file manually into your Liferay/deploy folder
  2. 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
Did this article resolve your issue ?

Legacy Knowledge Base