There are a few possible ways to configure the Miredot plugin in your project.
If you have all your REST interfaces in a single module, you should configure Miredot in the Maven or Gradle build file of that module.
my-project
├── src
| └── com.mycompany
| └── MyRestService.java *
└── pom.xml/build.gradle ⬅ Add Miredot here
my-project
├── my-api-module
│ ├── src
│ │ └── com.mycompany
│ │ └── MyRestService.java *
│ └── pom.xml/build.gradle ⬅ Add Miredot here
└── my-service-module
│ ├── src
│ | └── com.mycompany
│ | └── MyRestServiceImpl.java
│ └── pom.xml/build.gradle
└── pom.xml/build.gradle
* Java classes/interfaces annotated with jax-rs or spring-mvc annotations.
Some projects spread their API over multiple modules. If you want to have a single documentation for all the modules combined you should add Miredot to the parent pom.xml/gradle.build file. Miredot will aggregate the REST interfaces of all child projects.
If you have multiple API modules and want to document them separately, add Miredot to each module.
my-project
├── accounting
| ├── src
| | └── com.mycompany.accounting
| | └── AccountingService.java *
| └── pom.xml/build.gradle
├── users
| ├── src
| | └── com.mycompany.users
| | └── UserService.java *
| └── pom.xml/build.gradle
├── monitoring
| ├── monitoring-api
| │ ├── src
| │ │ └── com.mycompany.monitoring.api
| │ │ └── MonitoringService.java *
| │ └── pom.xml/build.gradle
| └── monitoring-service
| ├── src
| | └── com.mycompany.monitoring.service
| | └── MonitoringServiceImpl.java
| └── pom.xml/build.gradle
└── pom.xml/build.gradle ⬅ Add Miredot here for single aggregated documentation
for modules accouting, users, monitoring
my-project
├── accounting
| ├── src
| | └── com.mycompany.accounting
| | └── AccountingService.java *
| └── pom.xml/build.gradle ⬅ Add Miredot here
├── users
| ├── src
| | └── com.mycompany.users
| | └── UserService.java *
| └── pom.xml/build.gradle ⬅ Add Miredot here
├── monitoring
| ├── monitoring-api
| │ ├── src
| │ │ └── com.mycompany.monitoring.api
| │ │ └── MonitoringService.java *
| │ └── pom.xml/build.gradle ⬅ Add Miredot here
| └── monitoring-service
| ├── src
| | └── com.mycompany.monitoring.service
| | └── MonitoringServiceImpl.java
| └── pom.xml/build.gradle
└── pom.xml/build.gradle
* Java classes/interfaces annotated with jax-rs or spring-mvc annotations.
IMPORTANT We do not recommend configuring Miredot both on the parent AND on submodules as this might lead to double billing. Please contact us if you need to do this.
When configuring Miredot in Gradle for a single documantation in a multi-module project it is important that you call
apply plugin: 'java'
before apply plugin: 'miredot'
. Miredot must depend on all Java compile tasks so they need to
be defined before the Miredot plugin.
Miredot derives the source
and destination
configuration properties from the dependent Java compile tasks. If you
need to generate your documentation from sources other than the main sourceSet
, prefer overriding the dependsOn
property of the Miredot task over setting source
and destination
.
tasks.miredot.dependsOn = [ customCompileTask ]
Note the assignment to an array in the above statement. This is done so the default dependencies are removed, leaving only the custom compile task as dependency.
If you do set source
and destination
directly, make sure you set them to the aggregated project.