0

We have a project that make use of 'jrs-rest-java-client', version: '6.3.1'

The site we used to get the jar from has a certificate issue since September. https://jaspersoft.artifactoryonline.com

We then had to get the jar from a different site. https://jaspersoft.jfrog.io/

The problem is that a dependency require is missing, but if we use the jar that has "-jar-with-dependencies" it is working. I tried by downloading that jar locally and changing the .gradle to use the local version.

What I would prefer is to have the build to fetch that version directly without having to download first.

How do we specify what jar to use?

dependencies {
compile fileTree(dir: 'lib',
    includes: [
        'ojdbc8.jar',
     ])
    //compile group: 'com.jaspersoft', name: 'jrs-rest-java-client', version: '6.3.1'
    compile group: 'com.jaspersoft', name: 'jrs-rest-java-client', version: '6.3.1', USETHISONE: 'jar-with-dependencies'
    //compile files("${buildDir}/jrs-rest-java-client-6.3.1-jar-with-dependencies.jar")
}

I have now tried as suggested;

repositories {
    mavenCentral()
    // to handle broked jasper reports dependencies
    maven {
        url 'http://jasperreports.sourceforge.net/maven2'
        url 'https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/'
        url "https://jaspersoft.jfrog.io/jaspersoft/jaspersoft-clients-releases"
    }
}

dependencies {
    implementation project(':common:project-common-properties')
    implementation project(':common:project-common-mail')

    implementation fileTree(dir: 'lib', includes: [
        'ojdbc8.jar'
     ])
    implementation group: 'com.jaspersoft', name: 'jrs-rest-java-client', version: '6.3.1', classifier: 'jar-with-dependencies'
}

I'm still getting errors at build time...

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':services:notificationService:compileClasspath'.
> Could not find com.jaspersoft.jasperserver:jasperserver-dto:6.3.0.
  Required by:
      project :services:notificationService > com.jaspersoft:jrs-rest-java-client:6.3.1

That library is not required if the jrs-rest-java-client-6.3.1-jar-with-dependencies.jar is used.

Thanks all,

The solution was, as seen if the video (Thanks!) adding a new url:

 url "https://jaspersoft.jfrog.io/jaspersoft/jrs-ce-releases"
Andre Couture
  • 97
  • 1
  • 1
  • 8
  • If I understand correctly, you are not able to download `jrs-rest-java-client` using gradle. Am I right ? – Sambit Nov 19 '19 at 16:41
  • @Sambit your maven block is wrong. It should only contain one `url` in there. If you want multiple declare multiple, maven repos each with its own url. – smac89 Nov 20 '19 at 16:18
  • I tried that well with same results.. – Andre Couture Nov 20 '19 at 16:34
  • Just to be clear, I don't get that error you get when I use `jrs-rest-java-client-6.3.1-jar-with-dependencies.jar`. Something else must be requesting that dependency. – smac89 Nov 20 '19 at 16:47
  • could it be... other sub-project might be... but its ok now as I use the standard jar but included the proper repository and it works. Thanks – Andre Couture Nov 20 '19 at 18:10

1 Answers1

3

From the jfrog repo, it shows you how to do this:

compile(group: 'com.jaspersoft', name: 'jrs-rest-java-client', version: '6.3.1', classifier: 'jar-with-dependencies')

Add the repo for gradle:

repositories {
    jcenter {
        name "jaspersoft-releases"
        url "https://jaspersoft.jfrog.io/jaspersoft/jaspersoft-clients-releases"
    }
}

I'd recommend switching from compile to implementation and using a shorthand to declare the dependency:

implementation "com.jaspersoft:jrs-rest-java-client:6.3.1:jar-with-dependencies"

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for his life time.

I decided to record a short clip of how I found the appropriate repositories for the artifacts you needed, on jfrog:

enter image description here

smac89
  • 39,374
  • 15
  • 132
  • 179