Clone Build and Run from Source - tonygermano/connect GitHub Wiki
This document describes how to build and run NextGen Connect from its source.
Getting and Loading the Connect Source
Clone the NextGen Connect GitHub repository:
git clone https://github.com/nextgenhealthcare/connect.git
Create a local branch from development for your changes (SourceTree application shown in images).
Import the Connect projects into Eclipse
Download and install Eclipse.
- In Eclipse, File > Import > General > Existing Project into Workspace.
- Choose the root folder containing the git repo. This will contain subfolders for client, donkey, server, etc.
Select the main projects:
- Client
- Command
- Donkey
- Manager
- Server
- Webadmin
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
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.
Ensure ANT is configured to use Java 1.8.
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 "<!-- Uncomment the following and ... -->". There are several places in thebuild.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.
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...
Expand the Java Application section and you will see several Connect configurations:
- 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.
Configure it as necessary then click "Run".
If all goes well, you should see the Connect Administrator.
Note, IDE builds of Connect are self-signed. This means the Connect Administrator Launcher will not be able to validate the chain of trust and, thus, will not launch the client without you taking extra measures like 1) signing your Connect Jars with a trusted certificate (recommended) or 2) if you are just testing for development, forcing the Connect Administrator Launcher to allow Jars signed with a self-signed certificate (the
-k
option).
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.
Lastly, create your pull request in GitHub to merge your branch into development.