How to build WAR from command line if premium addons are used

Hello Cuba Team!!

I have downloaded the cuba studio now and while trying to generate the war it is throwing the exception.
For that I have gone through https://www.cuba-platform.com/discuss/t/target-buildwar-cannot-resolve-all-dependencies-cuba-6-4/1314/3 this link.

I tested for rootProject.hasProperty(‘premiumRepoUser’) which is displaying ‘true’ while running the application and taking the license key.
But while generating the war from Command Prompt rootProject.hasProperty(‘premiumRepoUser’) this is displaying ‘false’ and throwing exception.

Please find the below attached images for reference.

cmd-premiumuser

cubastudio-premiumrepouser

Thanks!!

Hi,

If your project uses Premium Add-ons, and you are starting build tasks outside Studio, pass the Premium Add-ons repository credentials in the command line arguments with -P prefix:

> gradle assemble -PpremiumRepoUser=111111222222 -PpremiumRepoPass=abcdefabcdef

See also: Starting Build Tasks - CUBA Platform. Developer’s Manual

I am able to build the war successfully by using the below one

gradle assemble -PpremiumRepoUser=111111222222 -PpremiumRepoPass=abcdefabcdef

Can you please say me At which location I will be able to get the war?

Because if i build the war with gradlew.bat extWarBuilding
then I can see my generated war in C:\Users\Sushma\Desktop\Project\project_cloud\build\distributions\war

WAR files are built only if your start buildWar task explicitly:

> gradle buildWar -PpremiumRepoUser=111111222222 -PpremiumRepoPass=abcdefabcdef 
1 Like

A post was split to a new topic: Gradle does not download premium artifacts from command line