Target buildWar cannot resolve all dependencies Cuba 6.4

After migrating to Cuba 6.4 and getting the application to run just fine in Studio, the buildWar task now reports dependency problems:


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'Base27'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.haulmont.fts:fts-global:6.4.0.
     Required by:
         :Base27:unspecified
      > Could not resolve com.haulmont.fts:fts-global:6.4.0.
         > Could not get resource 'https://repo.cuba-platform.com/content/groups/premium/com/haulmont/fts/fts-global/6.4.0/fts-global-6.4.0.pom'.
            > java.lang.NullPointerException (no error message)
   > Could not resolve com.haulmont.reports:reports-global:6.4.0.
     Required by:
         :Base27:unspecified
      > Could not resolve com.haulmont.reports:reports-global:6.4.0.
         > Could not get resource 'https://repo.cuba-platform.com/content/groups/premium/com/haulmont/reports/reports-global/6.4.0/reports-global-6.4.0.pom'.
            > java.lang.NullPointerException (no error message)
   > Could not resolve com.haulmont.charts:charts-global:6.4.0.
     Required by:
         :Base27:unspecified
      > Could not resolve com.haulmont.charts:charts-global:6.4.0.
         > Could not get resource 'https://repo.cuba-platform.com/content/groups/premium/com/haulmont/charts/charts-global/6.4.0/charts-global-6.4.0.pom'.
            > java.lang.NullPointerException (no error message)

This worked fine before and I do not know what to look for. Any help appreciated.

Checked with IntelliJ but it doesn’t report any problems. Not sure what to look for here.

Hi,

Assumably, the error occurred after migration to 6.4.

Let me explain how it works:
You are trying to build the project with dependency to new version of a premium component.
If you did not build the project after migration, the dependency was not cached. So Gradle should download it during task execution.

For access to the premium repo, Gradle should use your credentials. It takes them from environment variables: CUBA_PREMIUM_USER and CUBA_PREMIUM_PASSWORD.

If the variables are not set the task fails.

To build the project from command line adjust environment variables:
CUBA_PREMIUM_USER = the first part of your license key,
CUBA_PREMIUM_PASSWORD = the second part of your license key.

Studio successfully builds the project as it knows the credentials (you have input the license key).

Regards.

Well. I might be mistaken but my license key consists of three parts. I now get an ‘unauthorized’ error message. I have tried all combinations of the license key as first and second but without succes. Any help appreciated.

Sorry - wrong key. Is now fixed using the correct one. Thanks - can be closed.

Hello, I have the same trouble, could you tell more details, please, how I can enter CUBA_PREMIUM_USER? I tried in in Terminal but without success. Thank you.

Sorry, I fixed it. Just added file gradle.properties in to C:\Users\gasanyan.gradle
This file contains two single line:
premiumRepoUser=xxxxxxxxxxxxx
premiumRepoPass=xxxxxxxxxxxxx