此代码
BasicAWSCredentials credentials
= new BasicAWSCredentials(WasabiCredential.ACCESS_KEY, WasabiCredential.SECRET_KEY);
final AmazonS3 s3 = AmazonS3ClientBuilder
.standard()
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("s3.wasabisys.com", "us-east-1"))
.build();
投掷:
原因:java.lang.NoClassDefFoundError:com / amazonaws / auth / BasicAWSCredentials
给出:
BasicAWSCredentials.class
文件夹下的\com\amazonaws\auth
答案 0 :(得分:1)
有同样的问题。原来我的范围不正确,是:
<scope>test</scope>
因此,除了测试期间,其他任何地方当然都失败了。我删除了它,确实起到了帮助。