[英]maven build error when doing serverless deploy to aws ('dependencies.dependency.version' for com.amazonaws:aws-lambda-java-events:jar is missing)
I have a serverless aws / java project (simple hello world type).我有一个无服务器 aws / java 项目(简单的 hello world 类型)。
I can compile and build the application fine, but when I do a 'Deploy Serverless Application' on my template.yaml using IntelliJ IDE, I get a maven build error:我可以很好地编译和构建应用程序,但是当我使用 IntelliJ IDE 在我的 template.yaml 上执行“部署无服务器应用程序”时,我收到 Z402C5D9AF6B43711EA070BEE51707 构建错误:
Build Failed Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] 'dependencies.dependency.version' for com.amazonaws:aws-lambda-java-events:jar is missing. @ line 46, column 21 [ERROR] 'dependencies.dependency.version' for com.amazonaws:aws-java- sdk:jar is missing. @ line 52, column 21
My pom.xml is as follows for those two dependencies.对于这两个依赖项,我的 pom.xml 如下所示。 I also use DependencyManagement:
我也使用 DependencyManagement:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.651</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
</dependency>
I could revert to using < version > tags again but then the rest of my application won't build due to the other dependencies I have.我可以再次使用 < version > 标签,但是由于我拥有其他依赖项,我的应用程序的 rest 将无法构建。 Also, I find using aws-java-sdk-bom a clean way of managing dependencies without needing to worry about versions and compatibility.
此外,我发现使用aws-java-sdk-bom是一种管理依赖项的干净方式,无需担心版本和兼容性。
Checking on the pom.xml file of aws-jafa-sdk-bom on https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-bom/pom.xml Checking on the pom.xml file of aws-jafa-sdk-bom on https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-bom/pom.xml
The dependencies "aws-lambda-java-events" and "aws-java-sdk" are not defined.未定义依赖项“aws-lambda-java-events”和“aws-java-sdk”。
You should add the version number, for example:您应该添加版本号,例如:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>2.2.7</version>
</dependency>
Also, I haven't seen "aws-java-sdk" as a dependency anywhere.此外,我还没有在任何地方看到“aws-java-sdk”作为依赖项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.