Using SDK to upgrade openmrs-core

I’m not sure I’m understanding the best way to do this from the SDK documentation, so can someone clarify for me if there’s a command to deploy just a specific version of openmrs-core via the SDK?

What I’d specifically like to do is to:

  • deploy Platform 2.0.x
  • enter some data
  • deploy WAR for 2.1.0-SNAPSHOT
  • test that the upgrade worked

PS- in the Running and Debugging Servers sections of the docs it says that you can do this, and it will deploy openmrs-core:

mvn clean install openmrs-sdk:run -DserverId=myserver

…however I tried this from my openmrs-core directory and it did not work. (It built 2.1.0-SNAPSHOT, but then it just ran my server without actually deploying.)

I know that I can go to my openmrs-core directory and do openmrs-sdk:deploy but I’d like to understand what command would let me deploy just a specific version of openmrs-core, if I hadn’t built it locally.

@darius You need to run

mvn clean install openmrs-sdk:deploy openmrs-sdk:run -DserverId=myservr -DbatchAnswers=y

  1. You need to run openmrs-sdk:deploy

  2. The -DbatchAnswers=y provides an answer on the interactive question to deploy

  3. I usually add a -Dport=port# so that I can run multiple servers in parallel especially when tracking down an issue across multiple versions

Currently, there’s no way to deploy just war from mavenrepo (it used to be possible, but not anymore after we changed SDK to deploy platform). Technically mvn openmrs-sdk:deploy -DartifactId=openmrs-webapp -DgroupId=org.openmrs.web -Dtype=war -Dversion=2.1.0-SNAPSHOT should work, but it incorrectly appends “-omod” to “openmrs-webapp”…

mvn clean install openmrs-sdk:run -DserverId=myserver should also build and deploy core same as it works for modules…

Please create issues.

@raff Please clarify the above command should only deploy if the module is watched by the server, you need an explicit step to deploy when you run a server unless I am missing something. Is there some deploy magic that works when executing the command from the module folder?

I created