From 14ddcea34cd042c48c4bee0918aeedd05453bc6d Mon Sep 17 00:00:00 2001 From: David Good Date: Sat, 23 Jan 2021 19:53:51 -0500 Subject: [PATCH 1/5] Improve Building from Source Instructions Add a note to the Building From Source instructions to indicate that Python 3 is a requirement for building the archetype-lambda project. Add section about code generation and a tip to help IntelliJ IDEA users on how to fix class not found errors for generated code. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index dffdfcea0da6..2e784e8f5fce 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,8 @@ See the [Set up the AWS SDK for Java][docs-setup] section of the developer guide Once you check out the code from GitHub, you can build it using Maven. +Note: The `archetypes/archetype-lambda` project requires that you have Python 3 in your path as `python`. + ```sh mvn clean install @@ -126,6 +128,17 @@ mvn clean install -P quick mvn clean install -pl :s3 -P quick --am ``` +### Code Generation + +The SDK makes significant use of code generation which takes place at build time. During a Maven build, the +`build-helper-maven-plugin` takes care of making these additional generated source files available for compilation. + +However, your IDE may not automatically detect the generated code which can lead to class not found errors. +To fix this, you may need to instruct your IDE where to find the generated code: namely, in the +`target/generated-sources` of many of the projects in this repo. For example, in IntelliJ IDEA, you can do this by +opening `File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing` and setting +"Generated sources folders" to "target/generated-sources". + ## Sample Code You can find sample code for v2 in the following places: From fdc9677c14ef1b4b893c1c353e851d5474b784dd Mon Sep 17 00:00:00 2001 From: David Good Date: Sat, 23 Jan 2021 20:09:03 -0500 Subject: [PATCH 2/5] Add new change details --- .changes/next-release/feature-AWSSDKforJavav2-edd67d8.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/next-release/feature-AWSSDKforJavav2-edd67d8.json diff --git a/.changes/next-release/feature-AWSSDKforJavav2-edd67d8.json b/.changes/next-release/feature-AWSSDKforJavav2-edd67d8.json new file mode 100644 index 000000000000..af7388eb1f07 --- /dev/null +++ b/.changes/next-release/feature-AWSSDKforJavav2-edd67d8.json @@ -0,0 +1,6 @@ +{ + "type": "feature", + "category": "AWS SDK for Java v2", + "description": "Improve Building from Source Instructions", + "contributor": "helloworldless" +} From 454f4828b99edeb6ac4b741d5ae8d9e07bec358a Mon Sep 17 00:00:00 2001 From: David Good Date: Sun, 24 Jan 2021 10:20:17 -0500 Subject: [PATCH 3/5] Highlight the Option to Build a Specific Project --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2e784e8f5fce..13b64bfb1af7 100644 --- a/README.md +++ b/README.md @@ -118,14 +118,25 @@ Once you check out the code from GitHub, you can build it using Maven. Note: The `archetypes/archetype-lambda` project requires that you have Python 3 in your path as `python`. +### Build a Specific Service Module + +This is the fastest option if you only need to build a certain sub-project like S3 or the DynamoDB Enhanced Client. + +```sh +# Build a specific service module; Skip tests, checkstyles, findbugs, etc +mvn clean install -pl :s3 -P quick --am +``` + +### Build the Entire Project + +Note that this can take quite a long time to complete. + ```sh +# Build the entire project mvn clean install -# Skip tests, checkstyles, findbugs, etc for quick build +# Build the entire project; Skip tests, checkstyles, findbugs, etc mvn clean install -P quick - -# Build a specific service module -mvn clean install -pl :s3 -P quick --am ``` ### Code Generation From 95fa1dd84413b144ddca640cd4920357a0f97356 Mon Sep 17 00:00:00 2001 From: David Good Date: Sun, 24 Jan 2021 10:26:03 -0500 Subject: [PATCH 4/5] Use consistent language --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13b64bfb1af7..b58062368eb2 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Once you check out the code from GitHub, you can build it using Maven. Note: The `archetypes/archetype-lambda` project requires that you have Python 3 in your path as `python`. -### Build a Specific Service Module +### Building a Specific Service Module This is the fastest option if you only need to build a certain sub-project like S3 or the DynamoDB Enhanced Client. @@ -127,7 +127,7 @@ This is the fastest option if you only need to build a certain sub-project like mvn clean install -pl :s3 -P quick --am ``` -### Build the Entire Project +### Building the Entire Project Note that this can take quite a long time to complete. From 29657ab9437b0aead33f2a77a447a50a6dda5368 Mon Sep 17 00:00:00 2001 From: David Good Date: Mon, 25 Jan 2021 10:31:33 -0500 Subject: [PATCH 5/5] Update based on testing --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b58062368eb2..bdb0a2cc2378 100644 --- a/README.md +++ b/README.md @@ -146,9 +146,20 @@ The SDK makes significant use of code generation which takes place at build time However, your IDE may not automatically detect the generated code which can lead to class not found errors. To fix this, you may need to instruct your IDE where to find the generated code: namely, in the -`target/generated-sources` of many of the projects in this repo. For example, in IntelliJ IDEA, you can do this by -opening `File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing` and setting -"Generated sources folders" to "target/generated-sources". +`target/generated-sources` of many of the projects in this repo. + +In IntelliJ IDEA, the default setting of "Generated sources folders: Detect automatically" +under `File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing` should suffice. +However, you may still have to force a generated sources update by opening +`View | Tool Windows | Maven` and clicking the second icon from the left: +"Generate Sources and Update Folders for All Projects". Alternatively, if there is a specific project you would like +to build and you know which projects' generated code it depends on, you can force a generated sources update just for +those projects which will be much faster that generating sources for the entire project. For example, +the DynamoDB Enhanced Client (`services-custom/dynamodb-enhanced`) depends +directly or indirectly on code generated by DynamoDB (`services/dynamodb`), SDK Core (`core/sdk-core`), +and Regions (`core/regions`). So in this case, you can just find +"AWS Java SDK :: Services :: Amazon DynamoDB", "AWS Java SDK :: SDK Core", and "AWS Java SDK :: Regions" +in the Maven toolbar, right click on each, and choose "Generate Sources and Update Folders". ## Sample Code You can find sample code for v2 in the following places: