Maven Archetype for client applications using the AWS SDK for Java 2.x

March 27, 2023 ยท View on GitHub

Description

This is an Apache Maven Archetype to create a client application with a dependency of AWS Java SDK 2.x.

Features

The generated application has the following features:

  • Uses Bill of Materials to manage SDK dependencies
  • Contains the code to create the SDK client
  • Out-of-box support of GraalVM Native Image when nativeImage is enabled

Usage

You can use mvn archetype:generate to generate a project using this archetype. See maven archetype usage guidance for more information.

  • Interactive mode
mvn archetype:generate \
  -DarchetypeGroupId=software.amazon.awssdk \
  -DarchetypeArtifactId=archetype-app-quickstart \
  -DarchetypeVersion=2.x
  • Batch mode
mvn archetype:generate \
    -DarchetypeGroupId=software.amazon.awssdk \
    -DarchetypeArtifactId=archetype-app-quickstart \
    -DarchetypeVersion=2.x \
    -DgroupId=com.test \
    -DnativeImage=true \
    -DhttpClient=apache-client \
    -DartifactId=sample-project \
    -Dservice=s3  \
    -DinteractiveMode=false \
    -DcredentialProvider=default

Parameters

Parameter NameDefault ValueDescription
service (required)n/aSpecifies the service client to be used in the application, eg: s3, dynamodb. Only one service should be provided. You can find available services here.
groupId(required)n/aSpecifies the group ID of the project
artifactId(required)n/aSpecifies the artifact ID of the project
nativeImage(required)n/aSpecifies whether GraalVM Native Image configuration should be included
httpClient(required)n/aSpecifies the http client to be used by the SDK client. Available options are url-connection-client (sync), apache-client (sync), netty-nio-client (async). See http clients
credentialProviderdefaultSpecify the credential-provider to be used by the SDK client and imports relevant dependencies. Available options are default which uses the default credential provider chain, or identity-center whi uses IAM Identity Center
javaSdkVersionSame version as the archetype versionSpecifies the version of the AWS Java SDK 2.x to be used
version1.0-SNAPSHOTSpecifies the version of the project
package${groupId}Specifies the package name for the classes