Skip to content
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

Add Java Example #149

Merged
merged 17 commits into from
Jun 21, 2018
Merged

Add Java Example #149

merged 17 commits into from
Jun 21, 2018

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Jun 20, 2018

Add a Java "Hello, world" example.

  • Consume jsii and aws-cdk java via maven
  • Configure cdk.json to work idiomatically with the toolkit
  • Reorganize examples/ directory to cdk-examples-java and cdk-examples-typescript

By submitting this pull request, I confirm that my contribution is made under
the terms of the beta license.

Add a Java "Hello, world" example.

* Consume jsii and aws-cdk java via maven
* Configure cdk.json to work idiomatically with the toolkit
* Reorganize examples/ directory to cdk-examples-java and cdk-examples-typescript
@eladb eladb requested a review from RomainMuller June 20, 2018 12:54
@@ -0,0 +1,3 @@
{
"app": "/bin/bash run-program.sh"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would very much prefer delegating to java -jar ${jar built by mvn package}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, refactored the POM to produce a self-contained executable JAR and then we can run it with java -jar 🤗

<target>1.8</target>
</configuration>
</plugin>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would add the necessary things to produce a manifest that mentions the mainClass.

@eladb
Copy link
Contributor Author

eladb commented Jun 21, 2018

Lombok

I was just not super interested in hand-writing the PoJo and Builder for the props class. Any recommendation?

@RomainMuller
Copy link
Contributor

You're doing Java, so go ahead and use an IDE that writes those for you?

Elad Ben-Israel added 2 commits June 21, 2018 16:04
* Get rid of lombok
* Use syntax version 9
* Add validation logic
@eladb eladb merged commit 1c86838 into benisrae/java-maven Jun 21, 2018
@eladb eladb deleted the benisrae/java-example branch June 21, 2018 14:00
@eladb eladb restored the benisrae/java-example branch June 21, 2018 14:00
eladb pushed a commit that referenced this pull request Jun 21, 2018
Add a Java CDK app example to demonstrate how CDK can be used from Java.

The example demonstrates:

* Configuration of `cdk.json` to allow idiomatic use of the toolkit (`cdk synth`, `cdk deploy`).
* How to write a CDK app, stack, etc.
* How to write a reusable construct (`SinkQueue`) along with unit tests

See README file for more details.

Misc:

* Reorganize `examples/` directory to `cdk-examples-java` and `cdk-examples-typescript`
@eladb eladb deleted the benisrae/java-example branch July 18, 2018 18:29
@NGL321 NGL321 added the contribution/core This is a PR that came from AWS. label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants