This template is meant to be a starting point for developing a new OpenLMIS 3.x Extension Module.
- Docker 1.11+
- Docker Compose 1.6+
- Fork/clone this repository from GitHub.
git clone https://github.com/OpenLMIS/openlmis-template-module.git <openlmis-your-module-name>- Respectively change all instances of
openlmis-template-moduleandtemplate-modulewithin the project toopenlmis-your-module-nameandyour-module-name. - Change project name and description in
gradle.properties - Declare the service to be extended as a dependency using maven, e.g.:
dependencies {
compile "org.openlmis:openlmis-requisition:3.0.0-SNAPSHOT"
}
- Develop w/ Docker by running
docker-compose run --service-ports <your-module-name>. - You should now be in an interactive shell inside the newly created development environment.
- Add java code to the template. See Adding extension points.
- Assemble the outputs of project and create jar file by running
gradle assemble - Copy the generated jar to the
extensionsvolume of extended service and add your module as a dependency. Read more
- Annotate your implementation of the extension point with @Component and put its name in the value.
@Component("CustomExtendableComponent")
public class CustomExtendableComponent implements ExtendableComponent {
...
- Update
extensions.propertiesin theextensionsvolume of corresponding service with your components's id, e.g.:
# Extension configuration of some service
ExtendableComponent=CustomExtendableComponent
- The module needs to be signed with GnuPG key before publishing. Follow the instructions here if your don't have one.
- Move your secret keyring (
secring.gpg) to the.signingdirectory. - Edit
.envfile and changeSIGNING_KEYIDandSIGNING_PASSWORDwith your key id and password respectively. - By default, the template module is configured to publish to Sonatype OSSRH.
You can modify the repository urls inside
uploadArchivesgradle task. - Put your repository id and password in the
.envfile. - Run the builder. It should assemble the outputs, sign archives and publish your artifacts.
> docker-compose -f docker-compose.builder.yml run builder