当我运行时mvn package,Maven 返回一个错误:
[ERROR] /C:/git/java-project/src/main/java/example/Hello.java:[4,45] cannot find symbol
[ERROR] symbol: class Lambdalogger
[ERROR] location: package com.amazonaws.services.lambda.runtime
[ERROR] /C:/git/java-project/src/main/java/example/Hello.java:[8,17] cannot find symbol
[ERROR] symbol: class Lambdalogger
[ERROR] location: class example.Hello
这是我的 AWS Lambda 函数的 Java 代码(在Hello.java)
package example;
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.Lambdalogger;
public class Hello {
public String myHandler(int myCount, Context context) {
Lambdalogger logger = context.getLogger();
logger.log("received : " + myCount);
return String.valueOf(myCount);
}
};
所以看来 Lambdalogger 类无法解析,但为什么呢?但我的文件中列出了以下依赖项pom.xml:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
<version>1.2.0</version>
</dependency>
守候你守候我
相关分类