Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
Example:
<scm> <connection>scm:git:git@github.com:openmrs/openmrs-module-allergyapi.git</connection> <developerConnection>scm:git:git@github.com:openmrs/openmrs-module-allergyapi.git</developerConnection> <url>https://github.com/openmrs/openmrs-module-allergyapi.git</url> </scm>
<distributionManagement> <repository> <id>openmrs-repo-modules</id> <name>OpenMRS Nexus Modules</name> <url>http://mavenrepo.openmrs.org/nexus/content/repositories/modules</url> </repository> <snapshotRepository> <id>openmrs-repo-snapshots</id> <name>OpenMRS Nexus Snapshots</name> <url>http://mavenrepo.openmrs.org/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement>
It cannot have a 'pushChanges=false', and the tag name format should be set to the OpenMRS standard.
<pluginManagement> <plugin> <artifactId>maven-release-plugin</artifactId> <version>2.4.2</version> <configuration> <!-- remove the next line if it exists --> <pushChanges>false</pushChanges> <!-- add this line if it does not exist --> <tagNameFormat>@{project.version}</tagNameFormat> </configuration> </plugin> </pluginManagement>
<properties> <distro.groupId>org.openmrs.distro</distro.groupId> <distro.artifactId>referenceapplication</distro.artifactId> <distro.version>2.1-SNAPSHOT</distro.version> </properties> <dependencyManagement> <dependencies> <!-- Importing versions from refapp distro --> <dependency> <groupId>${distro.groupId}</groupId> <artifactId>${distro.artifactId}</artifactId> <version>${distro.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ... <pluginManagement> <plugin> <artifactId>maven-release-plugin</artifactId> <version>2.4.2</version> <configuration> <!-- refapp distro contains SNAPSHOT dependencies --> <allowTimestampedSnapshots>true</allowTimestampedSnapshots> </configuration> </plugin> </pluginManagement>
For each dependency of your omod and api that belongs to the distro, make sure it's provided or test scoped.
Keep the properties used to generate the config.xml file for your omod.
Generate a dependency tree of both versions (before the changes and after), and make sure the scope and the dependencies are correct. If it changed, try to identify what caused it.
Do a mvn package and confirm that inside omod/target/your module-1.0-SNAPSHOT/lib/ it's only shipping what it should include. If not, find the dependency added and change its scope to provided or test.
(temporarily it's in openmrs-contrib-bamboo repo)
When selecting the plan, Actions/Configure plan. Make sure to click in the plan level again in the configuration mode.
Add a link to the Releasing a Module from Bamboo page in the plan config. For example, 'More details of the release in https://wiki.openmrs.org/x/i4DTAw'
Change it to point to your repository.
Make sure you are using the correct java version in both the first stage and the release stage (controlled by the JAVA_HOME variable):
To run in JDK 7, you can just remove the JAVA_HOME variable in the release prepare/perform task (or use JAVA_HOME=${bamboo.capability.system.jdk.openjdk-7-jdk}).
If your build is going to trigger other plans, make sure to add to its dependencies.
If your module doesn't have any test cases, then Goto Configuration → Tasks → Maven 3 X. Then clear the selection of the "The build will produce test results". Otherwise you might get the build failures.
If your module is not part of the refapp distro, make sure to delete the relevant tasks in the 'Release to maven' job of your build:
Make sure to add your module to Releasing a New Version of a Module.
If you do not have access to bamboo, ask OpenMRS Help Desk.
4 Comments
Wyclif Luyima
In step 4 above, when setting a module to use versions of modules defined in the ref app distro, i think it is not correct to set allowTimestampedSnapshots to true, you should never release a module that has snapshot dependencies
Wyclif Luyima
I tried to release a module where i need a java 8 compiler to be used and it failed of course, the release stage executes a script that i have no access to nor do i have a way to tell it which compiler version to use, Cynthia Louis how do get around this?
Cintia Del Rio
Sorry to hear that. I haven't been able to help more on openmrs lately.
So, the release script are in https://github.com/openmrs/openmrs-contrib-bamboo, and you should be able to modify it (just make sure other releases will continue to work with the same script).
What you'll need to do it actually set the JAVA_HOME of the release task in Bamboo, the same way we are already setting the MAVEN_HOME. An example like https://ci.openmrs.org/build/admin/edit/editBuildTasks.action?buildKey=FHIR-FM-REL
Are you admin in Bamboo?nIf you give me the build you are trying to release I can do it for you and get you printscreens of the modifications.
Wyclif Luyima
I ended up doing a manual release before i read this, but i get what you're saying, I'll update the plan to set JAVA_HOME.
Thanks Cintia Del Rio