Error while building openmrs-core

Hi,

I want to start contributing to openmrs project. I am trying to build openmrs-core but I am getting some errors. I checked pom.xml, it is not able to find jacoco plugin. Also there are some properties which are not found like parsedVersion.minorVersion.

Could anyone please help me to setup my environment to get me going?

Regards, Shrikant Dange

You need to be explicitly clear with exact error you see. Snapshot of what you see on the UI and the complete stacktrace of the error.

Hi @ivange94,

Following is the compilation error:

ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/MemoryLeakUtil.java:[18,23] KeepAliveCache is internal proprietary API and may be removed in a future release

[ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/DateUtil.java:[12,16] error: package java.time does not exist

[ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/DateUtil.java:[13,25] error: package java.time.temporal does not exist

[ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/Concept.java:[1713,3] error: method setAttributes in class Concept cannot be applied to given types;

[ERROR] actual argument LinkedHashSet cannot be converted to Set by method invocation conversion /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/MemoryLeakUtil.java:[67,32] KeepAliveCache is internal proprietary API and may be removed in a future release

[ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/DateUtil.java:[27,2] error: cannot find symbol

[ERROR] class DateUtil /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/DateUtil.java:[27,49] error: cannot find symbol

[ERROR] class DateUtil /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/DateUtil.java:[27,24] error: cannot find symbol

Try to build from command line instead of an IDE.

I get same errors when I build from command line. Does this require Jdk1.8? I am using Jdk1.7.

Platform 2.0 requires java8. If you are building the master branch, then its 2.0 so you should probably be using java8. It should work fine, I just finished building.

Okay. I will try using Java8.

I tried with Java 8 still I am getting below error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project openmrs-api: Compilation failure: Compilation failure: [ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/MemoryLeakUtil.java:[18,23] KeepAliveCache is internal proprietary API and may be removed in a future release [ERROR] [ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/Concept.java:[1713,17] error: incompatible types: LinkedHashSet cannot be converted to Set [ERROR] [ERROR] /home/shrikant/OpenMRS/openmrs-core/api/src/main/java/org/openmrs/util/MemoryLeakUtil.java:[67,32] KeepAliveCache is internal proprietary API and may be removed in a future release

Make sure you are on the master branch and pulled the latest changes then try to build the module from the command line with mvn clean install

FWIW, he had to change to openjdk for this to compile.

@dkayiwa am not sure here why switching to openjdk was the solution. I used oracle jdk and I can build fine. Does it have something to do with his OS?

You raise a very good point. But i did not investigate further than that. :slight_smile:

I don’t think it’s due to OS. I still have some errors in pom.xml which I see in intellij.

Regards, Shrikant Dange