To get started create a vanilla confluence plugin

atlas-create-confluence-plugin

cd into the newly created maven project

then

atlas-create-confluence-plugin-module and select the REST module type

run up the embedded Confluence server (you dont need to specify the debug port option:-

atlas-debug -Djvm-debug-port=12005

The plugin will probably fail to deploy and you may notice a message saying it is disabled in the console. This looks to be a bug in the deployment process. 

Open up another terminal window, cd into the maven project folder and enter

atlas-cli

then enter pi to deploy your REST plugin and this time it should deploy successfully.

You should be able to access your plugin at :-

http://localhost:1990/confluence/rest/myrestresource/1.0/message

Which should show the XML :-

<message><value>Hello World</value></message>