Last active
February 28, 2018 18:34
-
-
Save thecarlhall/f4e8f425cb736938e1d2 to your computer and use it in GitHub Desktop.
Maven setup for integration testing with DynamoDB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project> | |
... | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-shade-plugin</artifactId> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>shade</goal> | |
</goals> | |
<configuration> | |
<transformers> | |
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> | |
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | |
<mainClass>com.cloudability.tags.App</mainClass> | |
</transformer> | |
</transformers> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>com.googlecode.maven-download-plugin</groupId> | |
<artifactId>download-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>install-dynamodb_local</id> | |
<phase>pre-integration-test</phase> | |
<goals> | |
<goal>wget</goal> | |
</goals> | |
<configuration> | |
<url>http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.zip</url> | |
<unpack>true</unpack> | |
<outputDirectory>${project.build.directory}/dynamodb</outputDirectory> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>build-helper-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<goals> | |
<goal>reserve-network-port</goal> | |
</goals> | |
<phase>initialize</phase> | |
<configuration> | |
<portNames> | |
<portName>dynamodblocal.port</portName> | |
</portNames> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>com.bazaarvoice.maven.plugins</groupId> | |
<artifactId>process-exec-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>dynamodb_local</id> | |
<phase>pre-integration-test</phase> | |
<goals> | |
<goal>start</goal> | |
</goals> | |
<configuration> | |
<name>dynamodb_local</name> | |
<waitAfterLaunch>1</waitAfterLaunch> | |
<arguments> | |
<argument>java</argument> | |
<argument>-Djava.library.path=dynamodb/DynamoDBLocal_lib</argument> | |
<argument>-jar</argument> | |
<argument>dynamodb/DynamoDBLocal.jar</argument> | |
<argument>-port</argument> | |
<argument>${dynamodblocal.port}</argument> | |
<argument>-sharedDb</argument> | |
<argument>-inMemory</argument> | |
</arguments> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins </groupId> | |
<artifactId>maven-failsafe-plugin</artifactId> | |
<configuration> | |
<systemPropertyVariables> | |
<dynamo.endpoint>http://localhost:${dynamodblocal.port}</dynamo.endpoint> | |
</systemPropertyVariables> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment