![](/img/trans.png)
[英]Properties file not added while trying to compile 'jar-with-dependencies' in Maven
[英]Gradle to use a jar-with-dependencies in compile task
我们有一个使用“jrs-rest-java-client”的项目,版本:“6.3.1”
我们用来获取 jar 的站点自 9 月以来就出现了证书问题。 https://jaspersoft.artifactoryonline.com
然后我们不得不从另一个站点获取 jar。 https://jaspersoft.jfrog.io/
问题是缺少依赖要求,但如果我们使用具有“-jar-with-dependencies”的 jar,它就可以工作。 我尝试在本地下载 jar 并将.gradle 更改为使用本地版本。
我更喜欢让构建直接获取该版本,而无需先下载。
我们如何指定使用什么 jar?
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")
}
我现在已经按照建议尝试了;
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'
}
我在构建时仍然遇到错误......
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
如果使用 jrs-rest-java-client-6.3.1-jar-with-dependencies.jar,则不需要该库。
谢谢大家,
解决方案是,如果视频(谢谢:)添加了一个新网址:
url "https://jaspersoft.jfrog.io/jaspersoft/jrs-ce-releases"
从jfrog repo中,它向您展示了如何执行此操作:
compile(group: 'com.jaspersoft', name: 'jrs-rest-java-client', version: '6.3.1', classifier: 'jar-with-dependencies')
添加 gradle 的仓库:
repositories {
jcenter {
name "jaspersoft-releases"
url "https://jaspersoft.jfrog.io/jaspersoft/jaspersoft-clients-releases"
}
}
我建议从compile
切换到implementation
并使用简写来声明依赖项:
implementation "com.jaspersoft:jrs-rest-java-client:6.3.1:jar-with-dependencies"
给一个人一条鱼,你就喂他一天。 教他如何钓鱼,你养他一辈子。
我决定在 jfrog 上记录我如何为您需要的工件找到合适的存储库的短片:
首先,您需要在 build.gradle 文件中添加存储库。 添加以下存储库。
repositories {
mavenCentral()
maven {
url "https://jaspersoft.jfrog.io/jaspersoft/jaspersoft-clients-releases"
}
}
有关更多详细信息,请参阅 go 到以下链接并单击链接“jaspersoft-clients-releases”。 向下滚动一点,您将能够看到要添加的存储库。 默认情况下,它提供 Maven,您只需复制 url 并粘贴到 build.gradle 的存储库部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.