我使用grails 3.1.1构建我自己的应用程序..
当我使用grails 2.1.1时,我使用这个jar文件来运行和编译pentaho报告。
但是现在,我正在尝试使用grails 3.1.1
我尝试下载并将此代码添加到我的build.gradle中,但我无法下载该文件。
compile 'pentaho:pentaho-database-model:5.1.preview.506'
compile 'pentaho-reporting-engine:pentaho-reporting-engine-classic-core:5.1.preview.506'
我试图刷新依赖关系..我得到了这个。
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>
答案 0 :(得分:1)
啊哈!问题是这些工件不在Maven中心。他们在Pentaho Maven存储库中。我用一个虚拟的Groovy脚本证实了这一点:
@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()
所以你需要做的就是将Pentaho Maven回购添加到你的项目中。只需编辑 build.gradle ,就像这样:
repositories {
...
maven { url "https://repo.grails.org/grails/core" }
maven { url "http://repository.pentaho.org/artifactory/repo"
}
提示:我使用https://maven-repository.com在Maven中查找工件(jar),并显示哪些Maven repo包含工件。假设它是网站索引的存储库之一。