-
Notifications
You must be signed in to change notification settings - Fork 912
Improve Building from Source Instructions #2257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
14ddcea
ab258b2
fdc9677
454f482
95fa1dd
29657ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "feature", | ||
"category": "AWS SDK for Java v2", | ||
"description": "Improve Building from Source Instructions", | ||
"contributor": "helloworldless" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,16 +116,51 @@ 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`. | ||
|
||
### 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. | ||
|
||
```sh | ||
# Build a specific service module; Skip tests, checkstyles, findbugs, etc | ||
mvn clean install -pl :s3 -P quick --am | ||
``` | ||
|
||
### Building 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 | ||
|
||
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. | ||
|
||
In IntelliJ IDEA, the default setting of "Generated sources folders: Detect automatically" | ||
under `File | Settings | Build, Execution, Deployment | Build Tools | Maven | Importing` should suffice. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would avoid giving super specific instructions on menu paths because they can vary - for example, in my IntelliJ the Maybe just mention |
||
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: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this info in the archetype-lambda README instead of the main README?
https://github.com/aws/aws-sdk-java-v2/blob/master/archetypes/archetype-lambda/README.md