version: 0.2

phases:
  install:
    commands:
    - pip install awscli --upgrade --user

  pre_build:
    commands:
    - DOC_PATH='s3://aws-java-sdk-javadoc/java/api'

  build:
    commands:
    - mvn install javadoc:aggregate -B -Ppublic-javadoc -Dcheckstyle.skip -Dspotbugs.skip -DskipTests -Ddoclint=none -pl '!:dynamodbdocument-v1,!:dynamodbmapper-v1,!:protocol-tests,!:protocol-tests-core,!:codegen-generated-classes-test,!:sdk-benchmarks,!:module-path-tests,!:test-utils,!:http-client-tests'
    - RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
    -
    - aws s3 sync target/site/apidocs/ $DOC_PATH/$RELEASE_VERSION/
    - aws s3 sync $DOC_PATH/$RELEASE_VERSION/ $DOC_PATH/latest/ --acl=public-read --delete
    - jar cf aws-java-sdk-v2-docs.jar -C target/site/apidocs .
    - aws s3 cp aws-java-sdk-v2-docs.jar $DOC_PATH/ --acl="public-read"

version: 0.2

phases:
  install:
    commands:
    - pip install awscli --upgrade --user

  pre_build:
    commands:
    - DOC_PATH='s3://aws-java-sdk-javadoc/java/api'

  build:
    commands:
    - mvn install -P quick -D maven.wagon.httpconnectionManager.maxPerRoute=2 -T1C
    - mvn install javadoc:aggregate -B -Ppublic-javadoc -Dcheckstyle.skip -Dspotbugs.skip -DskipTests -Ddoclint=none -pl '!:dynamodbdocument-v1,!:dynamodbmapper-v1,!:protocol-tests,!:protocol-tests-core,!:codegen-generated-classes-test,!:sdk-benchmarks,!:module-path-tests,!:test-utils,!:http-client-tests'
    - RELEASE_VERSION=`mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
    -
    - aws s3 sync target/site/apidocs/ $DOC_PATH/$RELEASE_VERSION/
    - aws s3 sync $DOC_PATH/$RELEASE_VERSION/ $DOC_PATH/latest/ --acl=public-read --delete
    - jar cf aws-java-sdk-v2-docs.jar -C target/site/apidocs .
    - aws s3 cp aws-java-sdk-v2-docs.jar $DOC_PATH/ --acl="public-read"

Fix javadoc command by running install first
Fix javadoc command by running install first
