figaf / cpi-gradle-plugin

Apache License 2.0
10 stars 2 forks source link

Error with task uploadArtifact #41

Closed Srinu3366 closed 2 years ago

Srinu3366 commented 3 years ago

I started getting errors with Gradle task uploadArtifact in the last couple of weeks. The Gradle plugin works fine for already existing projects but giving the below error for a new project I set up.

Error - In plugin 'com.figaf.cpi-plugin' type 'com.figaf.plugin.tasks.UploadArtifact' field 'uploadDraftVersion' without corresponding getter has been annotated with @Input.

Reason: Annotations on fields are only used if there's a corresponding getter for the field.

Possible solutions:
  1. Add a getter for field 'uploadDraftVersion'.
  2. Remove the annotations on 'uploadDraftVersion'.
dgraversen commented 3 years ago

Hi

We have made a few modifications over the last month. If you are using CF then the authentication is different and you will need to add some more parameters.

The easiest way to keep the update configuration is by using the Figaf Tool then the gradle will be updated.

In the build.gradle add the following cpiPlugin { url = cpiUrl username = cpiUsername password = cpiPassword platformType = cloudPlatformType loginPageUrl = "$project.loginPageUrl" ssoUrl = "$project.ssoUrl" oauthTokenUrl = "$project.oauthTokenUrl" authenticationType = "$project.authenticationType" publicApiClientId = "$project.publicApiClientId" publicApiClientSecret = "$project.publicApiClientSecret" waitForStartup = true sourceFilePath = "$project.projectDir".toString() uploadDraftVersion = true artifactType = "CPI_IFLOW" httpClientsFactory = new com.figaf.integration.common.factory.HttpClientsFactory( project.hasProperty('connectionSettings.useProxyForConnections') ? project.property('connectionSettings.useProxyForConnections').toBoolean() : false, project.hasProperty('connectionSettings.connectionRequestTimeout') ? project.property('connectionSettings.connectionRequestTimeout').toInteger() : 300000, project.hasProperty('connectionSettings.connectTimeout') ? project.property('connectionSettings.connectTimeout').toInteger() : 300000, project.hasProperty('connectionSettings.socketTimeout') ? project.property('connectionSettings.socketTimeout').toInteger() : 300000 ) }

If you upload the Gradle plugin to the latest versions your settings for CF should be something like

cpiUrl=https://3xxxxxx.cfapps.us10-001.hana.ondemand.com:443 cpiUsername=[email] cpiPassword=xxxxxxx cloudPlatformType=CLOUD_FOUNDRY ssoUrl=https://accounts.sap.com/saml2/idp/sso oauthTokenUrl=https://xxxxx.authentication.us10.hana.ondemand.com/oauth/token loginPageUrl=https://xxxxx.authentication.us10.hana.ondemand.com/login?login_hint=%7B%22origin%22%3A%22sap.default%22%7D authenticationType=BASIC publicApiClientId= publicApiClientSecret=

dgraversen commented 2 years ago

Could be because Universal ID has been added to the User.