I tried to make Alexa's skill with Java, so I will leave a memorandum. The environment uses AWS Cloud9.
[Cloud9]
1)
sudo yum -y update
sudo yum -y install java-1.8.0-openjdk-devel
3)
```sudo update-alternatives --config java
sudo update-alternatives --config javac
javac -version
mvn -version
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven```
7)
```mvn -version```
8) Change the deficit
#### **`mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false`**
*-DgroupId={group-id} *-DartifactId={project-name}
e.g) In the above case
"my-app
|- src
| - main |
- java
| - com |
- mycompany
| - app |
-App.java
|- test
| - java |
- com
| - mycompany |
- app
| - AppTest.java
- pom.xml"
■ pom.xml for Alexa
"<project xmlns=""http://maven.apache.org/POM/4.0.0"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
xsi:schemaLocation=""http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"">
mvn org.apache.maven.plugins:maven-assembly-plugin:2.6:assembly -DdescriptorId=jar-with-dependencies package
10) Upload the tar file to lambda
"With-dependencies" file
11) Put the following in the handler of the function code
#### **`com.amazon.ask.onseisuijaku.OnseiSuijakuStreamHandler`**
Done
Recommended Posts