Using private repository since 6.5 but build gradle auto changing post upgrade to 6.7

Hi,

I am hosting the cuba premium jars in a private repository as my production build machine does not connect to internet. I followed the doc at setting private repo but 1 more step I did. I removed following from the build.gradle file so that build machine does not complain missing environment variable.

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'))
    }
}

All was well and good in 6.5.x and 6.6.x platform/studio versions. However after upgrade to 6.7.2, studio keeps adding the same to build gradle upon launch. I revert the file and everything still works fine.

Thanks

Hi,

Studio adds premium repository to build.gradle when

  1. premium addons are enabled and
  2. one of ‘https://dl.bintray.com/cuba-platform/main’ or ‘Index of /groups/work’ is used as the main (the first in the list) repository in the project

Do you have bintray- or repo- in the list of repositories in your project?

Hi,

I indeed had ‘https://repo.cuba-platform.com/content/groups/work’ in my project repositories and it was listed above my private repo.

However, when I used studio to my private repo upwards, it introduced a compile error in build.gradle. PFA the git diff patch created on doing so.

patch.txt (1.2 KB)

I hand fixed it and moved my private repo above ‘https://repo.cuba-platform.com/content/groups/work’ but that did not solve the problem either.

In project settings, there are 2 sections, known and project repos. My repo is listed in project but not in known. Not sure if that matters.

Thanks

Hi,
We imply that if a private repo is used all the artifacts will be stored there. And public CUBA repositories will be deleted from the project repositories list.
If you need to use repo.cuba-platform.com you can leave the premium repository in build.gradle. Just erase credentials and Studio will not change the repositories block in that case.

    maven {
        url 'http://localhost:8081/repository/cubarepo/'
        credentials {
            username('myuser')
            password('mypass')
        }
    }
    maven {
        url 'https://repo.cuba-platform.com/content/groups/work'
        credentials {
            username('cuba')
            password('cuba123')
        }
    }
    maven {
        url 'https://repo.cuba-platform.com/content/groups/premium'
    }

Thanks,

This solves the issue. But you might want to still look at the issue where Studio generated invalid build gradle when reordering done from inside Studio.