-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OZ-468: Add docs to create own distribution. #4
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c716166
Add docs are starting with the archetype
ibacher 802063b
Update docs/custom-implementation.md
ibacher 533e7b6
OZ-450: Updated Quick Start and added implementer guide placeholder. …
rbuisson a23fc35
OZ-468: Add docs for Maven Archetype
rbuisson 80795de
Merge branch 'main' into ibacher-add-archetype-docs
rbuisson 40987c7
OZ-468: Remove impl-guide.md
rbuisson 344bd2e
Complete + format create-distro.md
mks-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Create Your Own Distribution | ||
|
||
!!! tip | ||
|
||
Install Git, Maven and Docker Compose | ||
|
||
HIS systems, like Ozone, often need to be heavily customized based on local needs. Ozone facilitates implementer's work by providing custom implementation configurations via a series of tools built on Apache Maven. The starting-point for a custom implementation is the Ozone Maven Archetype which creates a skeleton project that serves as a base for any particular customizations an implementation needs. | ||
|
||
## Maven Archetype | ||
|
||
|
||
#### Configure Maven | ||
|
||
Edit your Maven `settings.xml` file (often located in `~/.m2/settings.xml`) and add the following block to it: | ||
```xml | ||
<profiles> | ||
<profile> | ||
<id>ozone</id> | ||
<repositories> | ||
<repository> | ||
<id>archetype</id> | ||
<url>https://nexus.mekomsolutions.net/repository/maven-public</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
<checksumPolicy>fail</checksumPolicy> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
<checksumPolicy>warn</checksumPolicy> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
</profile> | ||
</profiles> | ||
|
||
<activeProfiles> | ||
<activeProfile>ozone</activeProfile> | ||
</activeProfiles> | ||
``` | ||
|
||
|
||
#### Generate the Archetype | ||
|
||
To get started, use Maven's archetype tools to generate a new Ozone implementation project. The command for doing this is: | ||
|
||
```bash | ||
mvn archetype:generate -DarchetypeArtifactId=maven-archetype -DarchetypeGroupId=com.ozonehis | ||
``` | ||
|
||
This will prompt you for several key variables for your implementation: | ||
|
||
* **distributionName:** A user-friendly name for your distribution. For example, an Ozone implementation for the country of Gruzinia might use "Gruzinia" as the distribution name. | ||
* **groupId:** This is the [Maven groupId](https://maven.apache.org/guides/mini/guide-naming-conventions.html) that will be used for the implementation artifact. For "Ozone Gruzinia", this might be: `gz.moh`. | ||
* **artifactId:** This is the [Maven artifactId](https://maven.apache.org/guides/mini/guide-naming-conventions.html) that will be used for the implementation artifact. For "Ozone Gruzinia", this might be: `ozone-grunzia`. | ||
* **package:** This is a required property, but not used. Just accept the default value, which should be the same as the **groupId**. | ||
* **version:** This is the version number for the distribution, which defaults to `1.0.0-SNAPSHOT`. | ||
|
||
This will create a bare-bones Ozone implementation project, which should look like this: | ||
|
||
``` | ||
<project root> | ||
| | ||
|--configs | ||
| | | ||
| |--openmrs | ||
| | | | ||
| | |--frontend_config | ||
| | |--initializer_config | ||
|--readme | ||
| |--impl-guide.md | ||
|--scripts | ||
|--.gitignore | ||
|--.gitpod.yml | ||
|--pom.xml | ||
|--README.md | ||
``` | ||
|
||
From this point on, your can run your new Ozone distribution with the following commands: | ||
|
||
## Build & Run | ||
```bash | ||
./scripts/mvnw clean package | ||
``` | ||
|
||
```bash | ||
source target/go-to-scripts-dir.sh | ||
./start-demo.sh | ||
``` | ||
|
||
## (optional) Stop & Destroy | ||
```bash | ||
./stop-demo.sh | ||
``` | ||
|
||
```bash | ||
./destroy-demo.sh | ||
``` | ||
|
||
Next is to customize Ozone to your needs. Check out to next page to override inherited configurations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the archectype actually generating not only a Maven project but also a local Git repository?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're creating a local Git repository. I didn't want to make assumptions about having anything other than Maven installed.