Cannot open cuba project as 1st time for migration

Hi,

I am following the documentation for opening in Idea existing 6.10.5 project to migrate into 7.2
I cleaned .idea folder. Set up the premium repo credentials into gradle.properties
Tryed open gradle.build and bam I am getting this error:

Could not get resource 'https://repo.cuba-platform.com/content/groups/premium/com/haulmont/reports/reports-global/6.10.5/reports-global-6.10.5.pom'.

Meanwhile, when I do for example gradle buildWar from the commandline it is building OK.
How I can resolve this, because the new CUBA plugin not showing up either because of this failure.

Best Regads

Hi,

The Studio 7+ does not pass your repository credentials to Gradle. If you need add-ons 6.x, please provide credentials in ~/.gradle/gradle.properties file as described in release notes.

Hi,

I did everything as the release notes stated.
I made a ~/.gradle/gradle.properties file wtih the following content (the original credentials are changed here due security reasosns)

premiumRepoUser=123456789012
premiumRepoPass=1AbcdAbcdA8

The build.gradle repositories section is looks like this:

buildscript {
    ext.cubaVersion = '6.10.5'
    repositories {
        maven {
            url 'https://repo.cuba-platform.com/content/groups/work'
            credentials {
                username(rootProject.hasProperty('repoUser') ? rootProject['repoUser'] : 'cuba')
                password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
            }
        }
        maven {
            url 'https://repo.cuba-platform.com/content/groups/premium'
            credentials {
                username(rootProject.hasProperty('premiumRepoUser') ?
                        rootProject['premiumRepoUser'] : System.getenv('CUBA_PREMIUM_USER'))
                password(rootProject.hasProperty('premiumRepoPass') ?
                        rootProject['premiumRepoPass'] : System.getenv('CUBA_PREMIUM_PASSWORD'))
            }
        }
    }
    dependencies {
        classpath "com.haulmont.gradle:cuba-plugin:$cubaVersion"
    }
}

The dependencies looks like this:

dependencies {
     appComponent("com.haulmont.cuba:cuba-global:$cubaVersion")
     appComponent("com.haulmont.reports:reports-global:$cubaVersion")
}

So I think I did everything as the release notes describes, but still I am not able to import a gradle project.

Best Regards

Sorry, I didn’t read your question carefully in the first place.

It means that Gradle has the credentials but Studio has not. So could you make sure that your subscription is used by Studio? You can check it in CUBA > Subscription Information window.
Also, what is your Studio plugin version?
image

Hi,

I have the latest CUBA plugin and it is saying it is registered. The ~/.gradle/gradle.properties file contains the same credentials as plugin sees and the same as in this site is stated on my account page.
5138

39

Hi,

I downloaded the new 8.1 plugin and the new 8.1 standalone (intellij version) studio.
With the old studio app I upgraded to 6.10.7 version my app.

I have a following observations:
The old studio app is working and can access the premium repo
The standalone 8.1 studio CAN open the app, and build sync the gradle (I can see in the log when it downloading report global from the premium repo), build the app.
The 8.1 plugin still CANNOT open the app. When it access the premium repo it is failing with “Unauthorized” error.

Hi,

Please check Global Gradle settings: Service directory path should point to the folder where is your gradle.properties file with credentials located.
2019-03-04_11-32-30

1 Like

Dear Alexander!

That did the trick! It is works now.
I have a .gradle dir in the project home too (don’t know when and why the CUBA studio did it).
Can I delete this?

Hi,

A .gradle directory in the project home is generated by Gradle build tool. You can delete it, but it will be generated on the next project sync.

1 Like