Could Not File: Corda Crash Shell during Gradle Build - corda

We are using artifactory to connect through a firewall to the internet. When running ./gradlew clean build we get the following exception message:
Could not resolve all dependencies for configuration ':java-source:testCompileClasspath'.
> Could not find com.github.corda.crash:crash.shell:9d242da2a10e686f33a3aefc69e4768824ad0716.
Searched in the following locations:
http://code-artifacts.bankofamerica.com:18081/artifactory/virtual-java/com/github/corda/crash/crash.shell/9d242da2a10e686f33a3aefc69e4768824ad0716/crash.shell-9d242da2a10e686f33a3aefc69e4768824ad0716.pom
http://code-artifacts.bankofamerica.com:18081/artifactory/virtual-java/com/github/corda/crash/crash.shell/9d242da2a10e686f33a3aefc69e4768824ad0716/crash.shell-9d242da2a10e686f33a3aefc69e4768824ad0716.jar
Required by:
project :java-source > net.corda:corda-node-driver:1.0.0 > net.corda:corda-test-utils:1.0.0 > net.corda:corda-node:1.0.0
We are wondering if the version number of crash.shell is having an affect on jar lookup.

In Corda V1.0, net.corda:corda-node:1.0.0 lists com.github.corda.crash:crash.shell:9d242da2a10e686f33a3aefc69e4768824ad0716 as a compile dependency. This corresponds to https://github.com/corda/crash/tree/9d242da2a10e686f33a3aefc69e4768824ad0716/shell.
If you are behind a firewall and this dependency isn't present in your artifactory, the build will fail.

This is now in the R3 corda-dependencies repo so you just need to update your build.gradle:
repositories {
jcenter()
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dependencies' }
}

Related

JFrog REST api client app fails to build with missing org.apache.commons.* packages

We have a Java app that was built using 2017 version of JFrog java services jar. Today I am trying to rebuild it using latest jfrog lib. I see that the new services jar doesn't have org.apache.* packages in it.
This is how I built jfrog services jar.
Downloaded 2.8.6 source zip and expanded it
Upgraded gradle to latest and ran "gradle clean build -x test -x javadoc"
Then copied services/build/lib/*services-2.8.6.jar ONLY to my project lib folder
When I try to build, I see so many compilation errors. The old lib was called something like artifactory-java-client-ning-services-1.2.0-all.jar.
How do I build one like it?
Update on 11/6/20 after Dror responses below:
I changed the build strategy to point to jcenter to download and create uber jar with all the dependencies with gradle file like below. I am still running into missing classes.
Below is one of those errors:
error: package org.jfrog.artifactory.client.ArtifactoryClient does not exist
import org.jfrog.artifactory.client.ArtifactoryClient.ProxyConfig;
In Netbeans IDE that I am using, I can expand each package in a jar and see the classes in it. I don't see anything under org.jfrog.artifactory.client package. That is strange.
My build.gradle:
group 'org.jftog.example'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.13
repositories {
jcenter()
}
dependencies {
compile 'org.apache.commons:commons-collections4:4.4'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation 'org.jfrog.artifactory.client:artifactory-java-client-services:+'
implementation 'org.jfrog.artifactory.client:artifactory-java-client-api:+'
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
Update on Nov 10th 2020:
I found that the artifactory sdk changed and I was using stale classes. I fixed those references in my classes to use newer SDK counterparts and the issues were gone.
I ended up using following gradle file to build everything I needed:
group 'artifactory-client-sdk'
version ''
apply plugin: 'java'
sourceCompatibility = 1.8
buildDir="${rootDir}/../out/artifactory_client_sdk"
def signbridge_lib="${rootDir}/../libs"
jar.baseName = 'artifactory-client-sdk'
repositories {
jcenter()
}
dependencies {
implementation 'ch.qos.logback:logback-classic:1.2.3'
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation 'org.jfrog.artifactory.client:artifactory-java-client-services:+'
implementation 'org.jfrog.artifactory.client:artifactory-java-client-api:+'
}
jar {
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA','**/org/jfrog/example'
}
task copyJar(type: Copy) {
from jar // copies output of file produced from jar task
into "${signbridge_lib}"
}
build.finalizedBy copyJar
Thanks a lot to Dror for great pointers!
The sources of the Artifactory Java client can be found in the jfrog/artifactory-client-java GitHub repository.
The services module used to be built as an uber jar containing 3rd party dependencies. On Oct 2019 the build has changed to create a thin jar instead of an uber jar.
To solve you issue you can either:
Include the 3rd party dependencies of the service module when building you application
Revert the change in build.gradle and continue to build an uber jar
Instead of building from source, you can consume the artifact from jcenter where is it being published by JFrog. The artifacts are published together with Maven .pom files which contains all the required 3rd party dependencies (all of them are available in jcenter).
In addition, there is an example Github project which shows how to consume the client library using Maven or Gradle.

Unable to build cordapp with accounts dependencies

I was able to build a cordapp using Accounts by following the steps at https://github.com/corda/accounts.
This cordapp was building and running until 03/16/2020, but since 03/20/2020 I am seeing errors in my CI builds because https://ci-artifactory.corda.r3cev.com/artifactory/corda-lib-dev/com/r3/corda/lib/accounts/accounts-contracts/1.0-RC04/accounts-contracts-1.0-RC04.jar cannot be accessed. I get a 409 response now, how can I resolve this?
{
"errors" : [ {
"status" : 409,
"message" : "The repository 'corda-lib-dev' rejected the resolution of an artifact 'corda-lib-dev:com/r3/corda/lib/accounts/accounts-contracts/1.0-RC04/accounts-contracts-1.0-RC04.jar' due to conflict in the snapshot release handling policy."
} ]
}
My build.gradle has
accounts_release_version = '1.0-RC04'
accounts_release_group = 'com.r3.corda.lib.accounts'
confidential_id_release_group = "com.r3.corda.lib.ci"
confidential_id_release_version = "1.0-RC03"
repositories {
maven { url 'http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib-dev' }
maven { url 'http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib' }
}
My local builds on my development environment work fine, I assume because I already have the jars in my .m2
Artifactory configuration has been changed to enforce separation between release and snapshot repositories. corda-lib-dev is a snapshot repo and CorDapp developers should not be developing against these.
Releases and release candidates will be available in corda-lib going forward.
Kindly use corda-lib, and develop again release 1.0.
The pom file with RC04 is set to return 409. I assume Corda's way to disallow use of RC04. May be RC03 is also the same. I just tried this today and saw the repository pom files.
Use "1.0" instead of "1.0-RC03"

Flutter - Error after include cloud firestore dependency.[Resolved]

I'd like a help to resolve this Issue. I cannot build my flutter application after insert the cloud firestore dependency at the pubspec.yaml
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.4.3+2
cloud_firestore: ^0.13.0+1
Error description:
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve io.grpc:grpc-core:[1.21.0].
Required by:
project :app > io.grpc:grpc-okhttp:1.21.0
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
Failed to list versions for io.grpc:grpc-core.
Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
Connection reset
This seems to be an internet connection problem, so please check your network.
This is more looking as if some connection issues are present,but if not then
First of all checkout your .gradle version it should be greater than 5
If you have created your project recently or under one month then you may need to check this step.
Then go to android/build.gradle and check your dependencies It should look like
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
If you donot use kotlin support then no need to write that classpath.Its for those who has kotlin support enabled by default.
In android/gradle.properties
you should have
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
in app level build.gradle
defaultConfig {
minSdkVersion 23
}
and most importantly you should have downloaded your google-services.json file in your android project folder. For Firebase you also require sha1 or sometimes sha256 keys.
Now it should run properly.
May it helped you :)
`

dependency resolution issue in gradle

i developed project in gradle using hadoop and hive dependencies below are the dependencies of project
org.apache.hive:hive-common:1.2.1'
'org.apache.hive:hive-service:1.2.1'
'org.apache.hive:hive-metastore:1.2.1'
'org.apache.derby:derby:10.11.1.1'
'org.apache.hive:hive-jdbc:1.2.1'
but i am facing below error which i am unable to resolve wonderful thing is that if i build the project using maven and added same dependencies in maven project its working fine could you please let me know problem associated with gradle
error:
Could not resolve all dependencies for configuration ':compile'.
> Could not find org.pentaho:pentaho-aggdesigner-algorithm:5.1.5-jhyde.
Searched in the following locations:
https://jcenter.bintray.com/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algorithm-5.1.5-jhyde.pom
https://jcenter.bintray.com/org/pentaho/pentaho-aggdesigner-algorithm/5.1.5-jhyde/pentaho-aggdesigner-algorithm-5.1.5-jhyde.jar
Required by:
:HiveUnit:unspecified > org.apache.hive:hive-service:1.2.1 > org.apache.hive:hive-exec:1.2.1 > org.apache.calcite:calcite-core:1.2.0-incubating
You need to add the suggested hack in your build.gradle file
repositories {
mavenCentral()
maven {
url "http://conjars.org/repo"
}
}
As hack could be used
repositories {
mavenCentral()
maven {
url "http://conjars.org/repo"
}
}

gradle sync failed due to ASCII open file

When i try to connect my project in firebase an error raise. It shows, gradle sync failed and ASCII open file. How to solve it? Please give a way.
I changed dependency at gradle.build - Project as follows :
dependencies { classpath 'com.android.tools.build:gradle:3.0.0' classpath 'com.google.gms:google-services:3.1.0' }

Resources