简体   繁体   English

如何将依赖项添加到 gradle / faas / visual studio code / java8

[英]how to add dependencies to gradle / faas / visual studio code / java8

I don't know how much time I lost on it.我不知道我为此浪费了多少时间。 I can't add to the simple faas function any jar.我无法将任何 jar 添加到简单的 faas function 中。

faas-cli new --lang java8 test --prefix="domain"
faas-cli build -f tes.tyml

Great!伟大的! - I have new simple and clean solution with java - 我有 java 的新的简单而干净的解决方案

then i opening build.gradle changes two lines: (adding one implementation and change repository to meaven)然后我打开 build.gradle 更改两行:(添加一个实现并将存储库更改为 meaven)

plugins {
    id 'java-library'
}

dependencies {
     api 'org.apache.commons:commons-math3:3.6.1'
     implementation 'net.sf.jasperreports.jasperreports:6.10.0'
     implementation 'com.google.guava:guava:23.0'
     testImplementation 'junit:junit:4.12'
     compile project(':model')
}
repositories {
    mavenCentral {}
}

faas-cli build -f test.yml ./web-proxy/build.gradle

and then BOOM然后繁荣

FAILURE: Build failed with an exception. FAILURE:构建失败并出现异常。

* What went wrong:
Execution failed for task ':function:compileJava'.
> Could not resolve all files for configuration ':function:compileClasspath'.
   > Could not find net.sf.jasperreports.jasperreports:6.10.0:.
     Required by:
         project :function

I can't add any jar to the faas java8 project for 4 hours!我无法将任何 jar 添加到 faas java8 项目 4 小时! please help nowadays i'm development .net and here i was supposed to do a small quick function with jasper and that's all请帮助现在我正在开发 .net 在这里我应该用碧玉做一个小的快速 function 就是这样

You have a typo in the Jasper reports dependency (the separation character between the Maven group ID and the artifact ID should be a colon, but you have a dot).您在 Jasper 报告依赖项中有拼写错误(Maven 组 ID 和工件 ID 之间的分隔符应该是冒号,但您有一个点)。 Try with this:试试这个:

implementation 'net.sf.jasperreports:jasperreports:6.10.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM