Skip to content

Commit 0818843

Browse files
author
John Tompkins
authored
Generate javadoc and source artifacts (#202)
* Adding necessary requirements to publish to maven * Javadoc addition to build * Javadoc issues * Removing shading * A couple of renames
1 parent ab65538 commit 0818843

File tree

3 files changed

+42
-72
lines changed

3 files changed

+42
-72
lines changed

pom.xml

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<name>AWS CloudFormation RPDK Java Plugin</name>
88
<description>The CloudFormation Resource Provider Development Kit (RPDK) allows you to author your own resource providers that can be used by CloudFormation. This plugin library helps to provide runtime bindings for the execution of your providers by CloudFormation.
99
</description>
10-
<url>https://aws.amazon.com/cloudformation</url>
10+
<url>https://github.com/aws-cloudformation/aws-cloudformation-rpdk-java-plugin</url>
1111
<licenses>
1212
<license>
1313
<name>Apache License, Version 2.0</name>
@@ -18,7 +18,7 @@
1818

1919
<developers>
2020
<developer>
21-
<id>amazonwebservices</id>
21+
<id>aws-cloudformation-developers</id>
2222
<organization>Amazon Web Services</organization>
2323
<organizationUrl>https://aws.amazon.com</organizationUrl>
2424
<roles>
@@ -45,6 +45,8 @@
4545
<mockito.version>2.26.0</mockito.version>
4646
<spotbugs.version>3.1.11</spotbugs.version>
4747
<spotless.version>1.23.1</spotless.version>
48+
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
49+
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
4850
</properties>
4951
<!-- https://docs.aws.amazon.com/sdk-for-java/v2/developer-guide/setup-project-maven.html -->
5052
<dependencyManagement>
@@ -63,7 +65,7 @@
6365
<dependency>
6466
<groupId>software.amazon.cloudformation</groupId>
6567
<artifactId>aws-cloudformation-resource-schema</artifactId>
66-
<version>1.0.3</version>
68+
<version>2.0.0</version>
6769
</dependency>
6870
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-databind -->
6971
<dependency>
@@ -257,34 +259,6 @@
257259
</compilerArgs>
258260
</configuration>
259261
</plugin>
260-
<plugin>
261-
<groupId>org.apache.maven.plugins</groupId>
262-
<artifactId>maven-shade-plugin</artifactId>
263-
<version>3.2.0</version>
264-
<configuration>
265-
<createDependencyReducedPom>false</createDependencyReducedPom>
266-
</configuration>
267-
<executions>
268-
<execution>
269-
<phase>package</phase>
270-
<goals>
271-
<goal>shade</goal>
272-
</goals>
273-
<configuration>
274-
<filters>
275-
<filter>
276-
<artifact>*:*</artifact>
277-
<excludes>
278-
<exclude>META-INF/*.SF</exclude>
279-
<exclude>META-INF/*.DSA</exclude>
280-
<exclude>META-INF/*.RSA</exclude>
281-
</excludes>
282-
</filter>
283-
</filters>
284-
</configuration>
285-
</execution>
286-
</executions>
287-
</plugin>
288262
<plugin>
289263
<artifactId>maven-surefire-plugin</artifactId>
290264
<version>3.0.0-M3</version>
@@ -389,6 +363,37 @@
389363
<failOnViolation>true</failOnViolation>
390364
</configuration>
391365
</plugin>
366+
<plugin>
367+
<groupId>org.apache.maven.plugins</groupId>
368+
<artifactId>maven-javadoc-plugin</artifactId>
369+
<version>${maven-javadoc-plugin.version}</version>
370+
<configuration>
371+
<show>public</show>
372+
<bottom><![CDATA[Copyright &#169; 2019 Amazon Web Services, Inc. All Rights Reserved.]]></bottom>
373+
</configuration>
374+
<executions>
375+
<execution>
376+
<id>attach-javadocs</id>
377+
<goals>
378+
<goal>jar</goal>
379+
</goals>
380+
</execution>
381+
</executions>
382+
</plugin>
383+
384+
<plugin>
385+
<groupId>org.apache.maven.plugins</groupId>
386+
<artifactId>maven-source-plugin</artifactId>
387+
<version>${maven-source-plugin.version}</version>
388+
<executions>
389+
<execution>
390+
<id>attach-sources</id>
391+
<goals>
392+
<goal>jar</goal>
393+
</goals>
394+
</execution>
395+
</executions>
396+
</plugin>
392397
</plugins>
393398
</build>
394399

src/main/java/software/amazon/cloudformation/proxy/CallChain.java

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,6 @@
2525
* a fluent API * design that ensure that right sequence of steps is followed
2626
* for making a service call.
2727
*
28-
* {@code
29-
* public class CreateHandler extends BaseHandler<CallbackContext> {
30-
*
31-
* @Override public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
32-
* final AmazonWebServicesClientProxy proxy, final
33-
* ResourceHandlerRequest<ResourceModel> request, final CallbackContext
34-
* callbackContext, final Logger logger) {
35-
*
36-
* final ProxyClient<KinesisClient> client =
37-
* proxy.newProxy(KinesisClient::create); final ResourceModel model =
38-
* request.getDesiredResourceState(); ProgressEvent<ResourceModel,
39-
* CallbackContext> created = proxy.initiate( "kinesis:CreateStream", client,
40-
* model, callbackContext)
41-
*
42-
* // // create request for a new stream // .request( (m) ->
43-
* CreateStreamRequest.builder() .streamName(m.getName())
44-
* .shardCount(m.getShardCount()).build() )
45-
*
46-
* // // Making the call via injection of credentials to make scoped credentials
47-
* work // .call((r, c) -> c.injectCredentialsAndInvokeV2(r,
48-
* c.client()::createStream))
49-
*
50-
* // // Currently any failure to stabilize will be propagated over as failure
51-
* to create. This means that // there is a likely hood that the stream could
52-
* have been created but we timed out. Any attempt to re-create // this resource
53-
* will fail with an already exists stream name. The stabiliserCreate provides
54-
* the // ARN in the model (side effect, maybe change model later to be
55-
* functional) from the describe calls. // So exceptions during stabilizes with
56-
* report event with FAILED, but the model has the ARN to // indicate successful
57-
* creation. So CFN can call us back with DELETE correctly. // IMP: if we do not
58-
* have read permissions during create, this will fail causing the resources to
59-
* // leak. // .stabilize( new Delay.Exponential(2, 2^5, TimeUnit.SECONDS),
60-
* this::stabilizeCreate) .done(CallChain.Callback.progress());
61-
*
62-
* } } }
6328
*
6429
* Any service call should use {@link AmazonWebServicesClientProxy}. Here is the
6530
* minimum sequence for the calls.
@@ -196,9 +161,8 @@ interface Exceptional<RequestT, ResponseT, ClientT, ModelT, CallbackT extends St
196161
* @param handler, a lambda expression that take the web request, response,
197162
* client, model and context and says continue or fail operation by
198163
* providing the appropriate {@link ProgressEvent} back.
199-
* @return {@link ProgressEvent#getStatus()} is
200-
* {@link OperationStatus#IN_PROGRESS} we will attempt another retry.
201-
* Otherwise failure is propagated.
164+
* @return If status is {@link OperationStatus#IN_PROGRESS} we will attempt
165+
* another retry. Otherwise failure is propagated.
202166
*/
203167
Completed<RequestT, ResponseT, ClientT, ModelT, CallbackT> exceptHandler(Callback<? super RequestT, Exception, ClientT,
204168
ModelT, CallbackT, ProgressEvent<ModelT, CallbackT>> handler);

src/main/java/software/amazon/cloudformation/scheduler/CronHelper.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ public CronHelper(final Clock clock) {
4444
* NOTE: CloudWatchEvents only support a 1minute granularity for re-invoke
4545
* Anything less should be handled inside the original handler request
4646
*
47+
* Expression is of form cron(minutes, hours, day-of-month, month, day-of-year,
48+
* year) where day-of-year is not necessary when the day-of-month and
49+
* month-of-year fields are supplied
50+
*
4751
* @param minutesFromNow The number of minutes from now for building the cron
4852
* expression
4953
* @return A cron expression for use with CloudWatchEvents putRule(..) API
50-
* @apiNote Expression is of form cron(minutes, hours, day-of-month, month,
51-
* day-of-year, year) where day-of-year is not necessary when the
52-
* day-of-month and month-of-year fields are supplied
5354
*/
5455
public String generateOneTimeCronExpression(final int minutesFromNow) {
5556
// Add additional 1 minute, since rule can be created after scheduled time, like

0 commit comments

Comments
 (0)