Blade Deploy Does Not Support WAR Files

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

解決

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
この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています