figaf / cpi-gradle-plugin

Apache License 2.0
10 stars 2 forks source link

Getting error while updating to Plugin version 2.1.RELEASE #24

Closed Srinu3366 closed 3 years ago

Srinu3366 commented 3 years ago

I am getting the below error while trying to upgrade the plugin to the latest version. It works fine until version 1.5

Could not resolve all artifacts for configuration ':classpath'. Could not find com.github.figaf:cpi-api:1.4. Searched in the following locations:

Thanks, Srini

NesterovIlya commented 3 years ago

Hello Srini,

Thank you for your request. We missed repositories declaration in the buildscript section (probably because we already have all dependencies in the local maven), now it's required. Add the following block to the beginning of the root build.gradle:

buildscript {
    repositories {
        mavenLocal()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

I've updated the README file, so, you can check updates there. Note that 2.*+ versions of the plugin have some changes in the task names and configuration because we've added value mappings and Cloud Foundry platform support. The actual configuration is described in README, but let me briefly highlight the most critical parts:

  1. Update your gradle.properties file, add cloudPlatformType property, possible values: NEO or CLOUD_FOUNDRY.
  2. Update subprojects configuration in the root build.gradle. Notice that now it's required to define artifactType on each submodule, we propose the following way:

    
    if (sub.name.startsWith("iflow-")) {
    
    apply plugin: 'com.figaf.cpi-plugin'
    
    cpiPlugin {
        url = cpiUrl
        username = cpiUsername
        password = cpiPassword
        platformType = cloudPlatformType
        waitForStartup = true
        sourceFilePath = "$project.projectDir".toString()
        uploadDraftVersion = true
        artifactType = "CPI_IFLOW"
    }

} else if (sub.name.startsWith("vm-")) {

apply plugin: 'com.figaf.cpi-plugin'

cpiPlugin {
    url = cpiUrl
    username = cpiUsername
    password = cpiPassword
    platformType = cloudPlatformType
    waitForStartup = true
    sourceFilePath = "$project.projectDir".toString()
    uploadDraftVersion = true
    artifactType = "VALUE_MAPPING"
}

}


3. Notice that 3 tasks in the plugin were renamed as they process not only iflows, but also value mappings. Update usages of these tasks in your code properly.

Let us know if you face any issues.

Ilya
Srinu3366 commented 3 years ago

Thanks, Ilya.

It worked like a charm now.

I like the feature to download a complete package in one step. It is very helpful with large packages.