Package net.officefloor.maven
Class AbstractStartSamMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- net.officefloor.maven.AbstractStartSamMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
RunSamMojo
,StartSamMojo
public abstract class AbstractStartSamMojo extends org.apache.maven.plugin.AbstractMojo
Starts SAM for the integration testing.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected int
samPort
Port for servicing SAM.
-
Constructor Summary
Constructors Constructor Description AbstractStartSamMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyDependencies()
Copies in the maven dependencies.DockerNetworkInstance
dockerNetwork()
Ensure the docker network is created.DockerContainerInstance
dynamoDb()
Starts DynamoDB.void
ensureTemplateYamlFileExists()
Ensures the template.yaml file exists.void
samBuild()
Undertakes SAM build.java.lang.Process
samLocalStartApi()
Starts the local SAM server.java.lang.Runnable
startSam()
Starts SAM-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Method Detail
-
ensureTemplateYamlFileExists
public void ensureTemplateYamlFileExists() throws org.apache.maven.plugin.MojoExecutionException
Ensures the template.yaml file exists.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
samBuild
public void samBuild() throws org.apache.maven.plugin.MojoExecutionException
Undertakes SAM build.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
copyDependencies
public void copyDependencies() throws org.apache.maven.plugin.MojoExecutionException
Copies in the maven dependencies.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
dockerNetwork
public DockerNetworkInstance dockerNetwork() throws org.apache.maven.plugin.MojoExecutionException
Ensure the docker network is created.- Throws:
org.apache.maven.plugin.MojoExecutionException
- If fails to create network.
-
dynamoDb
public DockerContainerInstance dynamoDb() throws org.apache.maven.plugin.MojoExecutionException
Starts DynamoDB.- Returns:
DockerContainerInstance
for managing DynamoDB.- Throws:
org.apache.maven.plugin.MojoExecutionException
- If fails to start.
-
samLocalStartApi
public java.lang.Process samLocalStartApi() throws org.apache.maven.plugin.MojoExecutionException
Starts the local SAM server.- Returns:
Process
for the local SAM server.- Throws:
org.apache.maven.plugin.MojoExecutionException
- If fails to start.
-
startSam
public java.lang.Runnable startSam() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Starts SAM- Returns:
Runnable
to stop.- Throws:
org.apache.maven.plugin.MojoExecutionException
- If execution issue.org.apache.maven.plugin.MojoFailureException
- If failure.
-
-