我有一个无服务器的aws / java项目(简单的hello world类型)。
我可以很好地编译和构建应用程序,但是当我使用IntelliJ IDE在template.yaml上执行“部署无服务器应用程序”时,出现了maven构建错误:
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
对于这两个依赖项,我的pom.xml如下。我也使用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>
我可以再次使用
答案 0 :(得分:1)
检查https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-bom/pom.xml上的aws-jafa-sdk-bom的pom.xml文件
未定义依赖项“ aws-lambda-java-events”和“ aws-java-sdk”。
您应该添加版本号,例如:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>2.2.7</version>
</dependency>
此外,我还没有在任何地方看到“ aws-java-sdk”作为依赖项。