Skip to content

Clone Build and Run from Source

Chris Turczynskyj edited this page May 7, 2020 · 6 revisions

Clone, Build, and Run from Source

Getting and Loading the Connect Source

Clone the NextGen Connect GitHub repository:

git clone https://github.com/nextgenhealthcare/connect.git

Git Clone

Create a local branch from development for your changes (SourceTree application shown in images).

Create Local Branch

Import the Connect projects into Eclipse

Download and install Eclipse.

  • In Eclipse, File > Import > General > Existing Project into Workspace.

Eclipse Import

  • Choose the root folder containing the git repo. This will contain subfolders for client, donkey, server, etc.

Eclipse Import

Select the main projects:

  • Client
  • Command
  • Donkey
  • Manager
  • Server
  • Webadmin

Eclipse Import

Click "Finish"

You now have Connect's source code loaded into Eclipse.

Building Connect

Connect uses Apache Ant for its build. In the Eclipse Menu show the Ant view:

  • Window > Show View > Ant

Eclipse Import

The build file mirth-build.xml will build:

  • CLI
  • Client
  • Donkey
  • Extensions (Server and Custom)
  • Manager
  • Server
  • WebAdmin

Load the Connect build file:

  • Drag Server/mirth-build.xml into the Ant view.

Add ANT Build

Ensure ANT is configured to use Java 1.8.

Configure ANT Build

Configure ANT Build

Click Apply

Note: If you need to build with another Java version (for example OpenJDK9), at the moment, you will need to edit the build.xml file and follow the instructions in the comments surrounded by "". There are several places in the build.xml file where this needs to be performed.

Start a build of NextGen Connect:

  • Double click "build [default]"

The full build will take some time, so the next section will detail how to make a good Bolognese sauce from scratch while you wait (kidding).

Once you see the glorious words "BUILD SUCCESSFUL" your build is complete.

Server Build Complete

You may need to refresh the projects in the Package Explorer to get it to recognize the build changes and remove any errors it sees.

Running Connect from IDE

Starting Connect Server

The Connect project includes run configurations so the first thing to do is load Connect's Run Configurations:

  • Eclipse menu > Run > Run Configurations...

Run Configurations

Expand the Java Application section and you will see several Connect configurations:

Run Configurations Server

  • Start with "Mirth Connect Server"

Here you can change the configuration like Java arguments and what JRE to use. Connect should just work with Java 1.8. However, if you need to use a different Java version (ex: OpenJDK9) then you will need to provide extra VM arguments. The list of arguments is located in the file mcservice-java9+.vmoptions:

  • Server > docs > mcservice-java9+.vmoptions

Click "Run"

The first time the Server project runs it will create an appdata directory when Connect Server doesn't see one.

You should see the following if it was able to successfully start Connect Server:

ERROR 2020-04-29 16:27:29,327 [main] com.mirth.connect.server.extprops.ExtensionStatuses: Unable to find appdata directory: appdata
INFO  2020-04-29 16:27:48,474 [Main Server Thread] com.mirth.connect.server.Mirth: Mirth Connect 3.9.0 (Built on April 29, 2020) server successfully started.
INFO  2020-04-29 16:27:48,477 [Main Server Thread] com.mirth.connect.server.Mirth: This product was developed by NextGen Healthcare (https://www.nextgen.com) and its contributors (c)2005-2020.
INFO  2020-04-29 16:27:48,478 [Main Server Thread] com.mirth.connect.server.Mirth: Running Java HotSpot(TM) 64-Bit Server VM 1.8.0_241 on Mac OS X (10.14.6, x86_64), derby, with charset UTF-8.
INFO  2020-04-29 16:27:48,480 [Main Server Thread] com.mirth.connect.server.Mirth: Web server running at http://192.168.1.31:8080/ and https://192.168.1.31:8443/

Starting Connect Client

Again, go to Run Configurations and this time select Mirth Connect Client.

Run Configurations Client

Configure it as necessary then click "Run".

If all goes well, you should see the Connect Administrator.

Client Run Success

Contribute Your Changes

After you've made your changes and you want to contribute them back to the open source project, you will need to commit and push your local branch to remote.

Commit and Push Local Branch

Lastly, create your pull request in GitHub to merge your branch into development.

Clone this wiki locally