restx/restx — pull request #72 by fcamblor (2014-03-18 02:05:55+00:00)
Title: App archive

Provided new `app archive` command, allowing to generate a restx archive.

Some insight about the restx archive : the `hello-world` application generated from a `restx app new` will generated something like this :
```
$> tree
.
├── META-INF
│ ├── restx
│ │ └── app
│ │ ├── data
│ │ │ ├── credentials.json
│ │ │ └── users.json
│ │ ├── md.restx.json
│ │ ├── module.ivy
│ │ ├── pom.xml
│ │ └── src
│ │ ├── main
│ │ │ ├── java
│ │ │ │ └── helloworld
│ │ │ │ ├── AppModule.java
│ │ │ │ ├── AppServer.java
│ │ │ │ ├── Roles.java
│ │ │ │ ├── domain
│ │ │ │ │ └── Message.java
│ │ │ │ └── rest
│ │ │ │ └── HelloResource.java
│ │ │ ├── resources
│ │ │ │ └── logback.xml
│ │ │ └── webapp
│ │ │ └── WEB-INF
│ │ │ └── web.xml
│ │ └── test
│ │ ├── java
│ │ │ └── helloworld
│ │ │ └── rest
│ │ │ └── HelloResourceSpecTest.java
│ │ └── resources
│ │ └── specs
│ │ └── hello
│ │ ├── should_admin_say_hello.spec.yaml
│ │ ├── should_user1_say_hello.spec.yaml
│ │ └── should_user2_not_say_hello.spec.yaml
│ └── services
│ └── restx.factory.FactoryMachine
├── helloworld
│ ├── AppModule.class
│ ├── AppModuleFactoryMachine$1.class
│ ├── AppModuleFactoryMachine$2.class
│ ├── AppModuleFactoryMachine$3.class
│ ├── AppModuleFactoryMachine$4.class
│ ├── AppModuleFactoryMachine$5.class
│ ├── AppModuleFactoryMachine.class
│ ├── AppServer.class
│ ├── Roles.class
│ ├── domain
│ │ └── Message.class
│ └── rest
│ ├── HelloResource.class
│ ├── HelloResourceFactoryMachine$1.class
│ ├── HelloResourceFactoryMachine.class
│ ├── HelloResourceRouter$1.class
│ ├── HelloResourceRouter.class
│ ├── HelloResourceRouterFactoryMachine$1.class
│ └── HelloResourceRouterFactoryMachine.class
└── logback.xml
```

ATM, I'm packaging sources files into the restx archive (because api doc might rely on it to display source contents)
For the same reason, I package the `src/test/*` file hierarchy.

You can test it easily :
```
restx app new
................
restx app archive /tmp/hello.jar
................
restx app grab file:///tmp/hello.jar + app run
```

FYI, I just created a `maven-restx-plugin` which will re-use the `RestxArchive.pack()` utility method, in order to package a standard restx archive (with `-restx` classifier).