Search code examples
javagrails

how to download pentaho database model and reporting engine?


i am using grails 3.1.1 to build my own application..

when i use grails 2.1.1, i used this jar file to run and compile pentaho report.

  • pentaho-report-model-5.1.0.0-752.jar
  • pentaho-reporting-engine-classic-core-5.1.0.0-752.jar

but now, i am trying to use grails 3.1.1

i tried to download with add this code to my build.gradle, but i cannot download that file.

compile 'pentaho:pentaho-database-model:5.1.preview.506'

compile 'pentaho-reporting-engine:pentaho-reporting-engine-classic-core:5.1.preview.506'

i tried to refresh dependencies..and i get this.

C:\Users\User\Documents\311\VPCnotificationServer>grails refresh-dependencies
> Configuring > 0/1 projects > root project > Resolving dependencies ':classpath
1/1 projects > Resolving dependencies ':agent' > Resolving dependencies 'detache

BUILD SUCCESSFUL

Total time: 7.172 secs
> Resolving dependencies ':testRuntime' > Resolving dependencies 'detachedConfig
| Error Could not resolve all dependencies for configuration ':testRuntime'. Typ
e 'gradle dependencies' for more information

C:\Users\User\Documents\311\VPCnotificationServer>

Solution

  • Aha! The problem is that those artifacts are not in Maven central. They're in the Pentaho Maven repository. I confirmed this with a dummy Groovy script:

    @GrabResolver(name='pentaho', root='http://repository.pentaho.org/artifactory/repo/')
    @Grab('pentaho:pentaho-database-model:5.1.preview.506')
    @Grab('pentaho-reporting-engine:pentaho-reporting-engine-classic-core:5.1.preview.506')
    
    class Hello {
        def speak() {
            println 'Hello'
        }
    }
    
    new Hello().speak()
    

    So all you need to do is add the Pentaho Maven repo to your project. Simply edit build.gradle like this:

    repositories {
        ...
        maven { url "https://repo.grails.org/grails/core" }
        maven { url "http://repository.pentaho.org/artifactory/repo" 
    }