• Uncategorized
  • 0

How to build an Amazon Alexa Skill

Here are the steps I took to build an Amazon Alexa Skills App using Maven and the Java SDK.

    • Start by setting up your environment and installing Maven
    • use this tutorial to build your shell java app – https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
    • As per the tutorial, run the following command:

mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

    • The above command will build the shell for you
    • Add any dependencies and plugins into the POM.xml file
    • Add all your Java files to the following path: <artifactID>\src\main\java\com\<groupID>\app
    • Add any libraries to <artifactID>\src
    • Once everything is in place, you are ready to build your project
    • Follow the instructions here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/deploying-a-sample-skill-to-aws-lambda
    • You will need to run the following command to build your project:

mvn assembly:assembly -DdescriptorId=jar-with-dependencies package

  • That will create a JAR file that you will need later to upload to LAMBDA
  • The JAR file will be located in a new folder called Target. The file you need will end in -jar-with-dependencies.jar


Now that you have built your project, you are ready to upload the package to Lambda.

  • In AWS, go to Lambda
  • Click Create Lambda function
  • Under Select Blueprint, select Blank Function
  • on the next screen, (Configure Triggers), select the blank dotted line square, and select Alexa Skills Set from the list
  • Click Next, then give your function a name
  • Change the runtime to Java 8
  • Under Lambda function code, you can upload your JAR file
  • Under Lambda function handler and role type in the Handler name.  The Handler will be the handler method called in your Java file.
  • Under Role, you can select an existing Role, or create a new one
  • You can leave all the other fields the same
  • Confirm all the settings are correct on the next page, then click Create Function

To Test your package, you can click the Test button. The input test event screen should appear.  In the dropdown, select Alexa Start Session

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *