Application Name: Reference Application
Version Number: 2.0
Question:
I set up my development environment as instructed at the GitHub repo using Vagrant.
mvn clean package succeeds without errors. But running vagrant up throws a maven build error within the guest VM. Specifically, a checksum mismatch comes up due to a plugin being not available at the path the guest VM checks. This happens for the org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom and the build stops there. The packaging process correctly downloads the plugin and adds it to local maven repo. Then the guest VM checks this file against the one it tries to download from the following path:
Yes, I was able to successfully run a server through the SDK previously. I see that we can also deploy a packaged distro from any folder. Tried that with this build and it works too, thank you
Is the Vagrant error due to outdated files in the given virtual machine image?
Anyone looking to fix a Reference App issue would go the way I went. Newcomers, like me, might follow the instructions at the Reference App’s GitHub repo and the wiki page. This means they’ll get stuck too. The wiki page and the Readme of the GitHub repo need to be updated to reflect the new deploying mechanisms. Shall I do that?
I wouldn’t say it’s too fast. But it hasn’t been fully documented so it’s confusing.
I’ve been testing possible methods of setting up a dev environment for the Reference Application with local builds and so far I’ve come up with the following;
OpenMRS SDK
Setup server with platform version
Build RA from GitHub sources
Manually copy modules from the built distro to server modules folder in openmrs at User Account root.
With Tomcat
Build RA from GitHub sources
Copy built openmrs platform from distro to Tomcat Webapps folder
Copy modules from the built distro to server modules folder in .OpenMRS (note the difference in folders) at User Account root.
Deploying with Tomcat throws up a UI Framework error as shown here.
I suspect the following methods are also possible, but haven’t been able to test them with my limited knowledge as a newcomer.
Build server and run it offline with locally built Ref App through SDK.
I would like to know how to achieve this last method and whether I am missing any other mechanisms.
Especially, I could not find instructions on how to run a local build of Ref App on top of a server from SDK in one command. If I understood correctly, the method mentioned here by @darius sets up a Ref App instance with data fetched from remote repositories.
As for the error you are getting, i suspect that you are using the snapshot version of platform. This will result into errors until all the REST resources add support for it. The solution therefore is that you used a released version of the platform.
Strangely, the error did not come with the snapshot version of the platform.
Maybe I didn’t make myself clear enough. The aim is to develop the Reference Application - like work on a ticket, do development work, and then test whether the changes work. This is not to try out the Reference Application - it’s to develop the Ref App itself. Not its modules either, since most modules have their own repo.
OpenMRS Standalone is to try the Ref App, is it not? It’s not meant to be used for development.
Chanuka, when developing RA you basically setup a server using the latest SNAPSHOT version of RA. Call openmrs-sdk:setup, choose distribution and select Reference Application 2.6-SNAPSHOT.
Next you add modules you will be changing to the list of watched modules for that server. It means that whenever you startup the server, those modules will be built from source and deployed to the server. See watching projects.
In addition if you make any changes in the web layer by modifying controllers, gsps, js files, etc. they will be deployed instantly without having to restart the server.
@dkayiwa I’ll look into how the Standalone can be used for development. Seems it’ll need some manual file swapping. For now I’ll just add a reference to the SDK from the RA distro Repo’s Readme file, then.
@raff Thank you for the great explanation, solidified what I learned from the Wiki! The instant deploying feature is quite useful.
Quick question, how would one test a change to a file like this?
Understood, thanks! That was an example, but since there isn’t much else other than UI tests in the ref app distro repository, there’s usually nothing one would need to change in that repo I suppose.