Introduction
Mirth Connect consists of six related projects: server, donkey, client (Administrator), manager (Server Manager), command (CLI), and webadmin (Web Dashboard). This article describes how to checkout the source for these projects into Eclipse.
Prerequisites
- Oracle Java JDK 1.7
- Eclipse IDE for Java Developers
- Subclipse 1.8.x
- Apache Ant 1.8.2 or later (usually included with Eclipse)
Instructions
- From Eclipse, go to File > New > Other... > SVN > Checkout Projects from SVN.
- Create a new repository location with "https://svn.mirthcorp.com/connect/".
- Select the trunk/server directory and click Finish.
- Repeat the above steps with the client, command, manager, donkey, and webadmin directories under trunk.
- You should now have six separate projects in Eclipse named Client, Command, Manager, Donkey, WebAdmin, and Server. You will notice that several of the projects have build errors. This is because you need to run an initial build that will copy artifacts across projects.
- Open the Ant view (Window -> Show View -> Ant), and drag mirth-build.xml into the view.
Double-click the mirth-connect Ant task to execute the default "build" target.
- When the build completes, refresh and clean the Client, Command, Manager, Donkey, WebAdmin, and Server projects.
- Under the Run button you should have four new run configurations for each project. Select the Mirth Connect Server. Once you see the splash screen appear in your console, you can start the Mirth Connect Client.
12 Comments
satyam kumar
Repository has changed to https://svn.mirthcorp.com/connect
M Ensing
Jacob, Thanks for the update. I was not 100% sure if me, as a newbie, was doing it right.
Souvick de
hi Jacob,
I have installed a distribution of Mirth 3.
I extracted the mirth-client.jar from under client-lib folder.
I have also downloaded the mirth 3 source from SVN/tags/3.0.0 have tried to change few things in the ui/file LoginPanel.java/form underclient/ui.
I have compliled the file successfully and picked up the classes and have replaced the class files back into extracted mirth-client.jar into its respective folder.
I removed all files under META-INF except manifest.mf
I edited the file mafest.mf and deleted all signatures keeping the class names intact.
Then I repackaged into mirth-client.jar.
Then I signed it using the keystore which I got under the source code under server/keystore.jks
I replaced the original mirth-client.jar into the distribution with the new mirth-client.jar undet client-lib folder.
Now, when I try to run the client I get this error -
"jar resources in jnlp file are not signed by the same certificate"
I dont know exactly what would be the better way of getting around this error. Please help
Souvick
David Mooney
Step 4 – What about generator and simplesender? I see those on the svn server but they are not mentioned in the instructions.
Chris Van Vranken
I tried building Mirth Connect using Ant from the command line. But that failed with the following error message:
jspc:
BUILD FAILED
C:\users\cvanvranken\Documents\Github\mirth-3.1.1\trunk\server\mirth-build.xml:30: The following error occurred while executing this line:
C:\users\cvanvranken\Documents\Github\mirth-3.1.1\trunk\webadmin\build.xml:47: jasper2 doesn't support the "addWebXmlMappings" attribute
I submitted a support ticket and was told I should build inside of Eclipse with the Ant View
Yu Justhing
Enter keystore passphrase ? Wath's the key?
Daniel Fauraz
Since version 3.2, JDK 7 needs to be used to compile MC
Frank Parth
Checking out with JDK 8 and Eclipse Mars found I had to add this setting in eclipse.ini to allow it to be checked out from SVN repo:
Daniel Fauraz
trunk now needs JDK 8 to compile, e.g. with the use of lambda expressions in:
com.mirth.connect.client.ui.components.tag.MirthTagWebController.updatePopupWindow(String)
Mitch Trachtenberg
I have tried to follow these instructions. My console generates a lot of text that starts as follows:
Buildfile: E:\workspace2\Server\mirth-build.xml
init:
build-donkey:
init:
clean:
[delete] Deleting directory E:\workspace2\donkey\classes
[delete] Deleting directory E:\workspace2\donkey\setup
compile:
[mkdir] Created dir: E:\workspace2\donkey\classes
[javac] Compiling 164 source files to E:\workspace2\donkey\classes
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
build-model:
[jar] Building jar: E:\workspace2\donkey\setup\donkey-model.jar
build-server:
[jar] Building jar: E:\workspace2\donkey\setup\donkey-server.jar
[copy] Copying 24 files to E:\workspace2\donkey\setup\lib
create-setup:
[mkdir] Created dir: E:\workspace2\donkey\setup\docs
[copy] Copying 1 file to E:\workspace2\donkey\setup\docs
build:
[delete] Deleting directory E:\workspace2\server\lib\donkey
[copy] Copying 1 file to E:\workspace2\server\lib\donkey
[copy] Copying 1 file to E:\workspace2\server\lib\donkey
[copy] Copying 4 files to E:\workspace2\server\lib\donkey...
There are a lot of warnings, including warnings like this: Warning: E:\workspace2\server\lib\extensions\datapruner does not exist.
But nothing says "BUILD FAILED."
Eventually, the build ends with the following:
...test-run:
init:
test-init:
test-compile:
[mkdir] Created dir: E:\workspace2\client\test_classes
[javac] Compiling 1 source file to E:\workspace2\client\test_classes
test-run:
init:
remove-classes:
init:
remove-classes:
[delete] Deleting directory E:\workspace2\donkey\classes
[delete] Deleting directory E:\workspace2\donkey\test_classes
init:
remove-classes:
[delete] Deleting directory E:\workspace2\server\classes
[delete] Deleting directory E:\workspace2\server\test_classes
init:
remove-classes:
[delete] Deleting directory E:\workspace2\client\classes
[delete] Deleting directory E:\workspace2\client\test_classes
BUILD SUCCESSFUL
Total time: 2 minutes 35 seconds
However, the Eclipse neon.3 package explorer shows a red explanation point
for Client and Server, red "x"s on the lower left corner of the file folder icons for Command and Manager, and WebAdmin.
When I attempt to run the server by right-clicking on "Mirth Connect Server.launch 8075" in the server package, and selecting "Run as / Mirth Connect Server" I get a dialog box telling me that the project has errors. If I proceed with the launch, I get an immediate message telling me "could not find or load main class com.mirth.connect.server.Mirth
On the "Create, manage, and run configurations" dialog I have the following:
The run configuration for Server has project: Server, Main class com.mirth.connect.server.Mirth, and no checkboxes checked for including system libraries or inherited mains when searching for a main class.
The VM arguments are -Xmx512m (line) -Djava.awt.headless=true (line) -Dapple.awt.UIElement=true, and working directory set to the default of ${workspace_loc:Server}
The JRE is set to Project JRE (jdk1.8.0_112)
The Classpath shows JRE System Library under Bootstrap Entires and Server (default classpath) under User Entries.
The Source is "Default".
Environment tab is empty.
Common tab has Shared file: \Server and allocate console is checked.
I am unfamiliar with Ant, somewhat familiar with Maven. I'm sure I'm making some obvious mistake. Can anyone tell me what it might be? Any assistance appreciated.
Thanks.
Mitch
Mitch Trachtenberg
I don't follow what is going on, but after going through the build again (and getting similar results) I am now able to run the server, and the Eclipse GUI does not show exclamation points or "x"s. I note that the version is reported as 3.6.0.
Mitch Trachtenberg
Well, another newbie question. I have Mirth server running in eclipse. I attempted to add logger calls in DonkeyMessageController.java.
On startup, the server prints INFO messages to the eclipse "console" window, and a logger.info("Test"); from within a Javascript transformer shows up when I process a message on a channel. However, a call from inside DonkeyMessageController to logger.info("From DonkeyMessageController"); does not produce output in the eclipse console, even though creating a PrintWriter and writing to it from within DonkeyMessageController.java "reprocessMessages" does write to an external file.
I'm clear that I'm missing something about internal calls to logger, but not clear on what. Any ideas welcome. Thanks.