Bootstrapping a project manually
RESTX being a java framework, you can use it without actually installing the shell: use your favorite build tool / dependency manager, and a dependency on the modules you want.
Though note that in that case you won’t benefit from the power of the shell which eases a lot of use cases, especially this process of bootstrapping a project. If you have installed the RESTX shell we strongly recommend using it to get started.
But if you want to remain independent from the shell, stay in control of the framework, or simply because you want to introduce it in an existing app, this documentation is made for you.
Once you will have performed these steps, also have a look at IDE setup documentation, you may need to enable annotation processing manually depending on your IDE.
Declaring dependencies
The minimum in most cases if you want to use RESTX REST support is to declare a dependency on restx-core and restx-core-annotation-processor.
Here is an example with Ivy:
And an example with Maven:
You get the idea, do this with your favorite build tool.
web.xml configuration
If you want to use RESTX inside a JavaEE / servlet container, you will have to:
- declare a dependency on restx-servlet:
- add this snippet to your web.xml:
Note that you can change the servlet path to the one of your choice, mounting RESTX on /api/*
is only what we use most of the time.
configure logs
RESTX relies on SLF4J for logging, we recommend logback for the implementation.
All you need to do is:
- declare a dependency on logback-classic:
- define a logback.xml at the root of your classpath resources: