SDK module failing to build due to NullpointerExceptions And integrationTest failures(Resolved)

Hello Friends

Have been trying to build openmrs-sdk module while trying to fix a small issue via mvn clean install by default ,

However i encountered failing integration tests, am not sure if anyone have encountered this before, here is the pastebin link for the error logs nTest[ERROR] deploy_shouldUpgradeDistroTo2_3_1(org.openmrs.maven.plugins.Deplo - Pastebin.com . Am not exactly sure whether this is a problem with maven version am using.which is 3.6.3 which i think its compatible with sdk maven version

There is a null pointer exceptions in this file openmrs-sdk/PullIntegrationTest.java at master · openmrs/openmrs-sdk · GitHub which i guess its needed to attend to. cc @dkayiwa @ibacher @mogoodrich @bistenes

When did it start breaking (either in Bamboo or in its commit history)?

Not exaxctly sure when ,however when i tried build the module, it could fail to build not sure whether @ibacher encountered these failures of recentwith error logs Documents/openmrs-sdk$ mvn clean install[INFO] Scanning for projects...[INFO - Pastebin.com not sure whether its on my m2e folder with no mvn dependencies.

@sharif Per that log, the underlying issue is not the NPE (which happens in an @After part of the test anyways), but this:

/bin/sh: 1: /opt/apache-maven-3.6.3/bin/mvn: not found

If you look above that line, you’ll see that it’s trying to run a line like this:

/opt/apache-maven-3.6.3/bin/mvn -DopenMRSPath=/home/sharif/Documents/openmrs-sdk/integration-tests/target/test-classes/integration-test -Ddistro=referenceapplication:2.2 -Ddebug=1044 -DdbDriver=mysql -DdbUser=mysql -DdbPassword=mysql -DdbUri=@DBNAME@ -DdbSql=null -DbatchAnswers=f3783fc3-227d-4664-ac14-dcbaff06c1ac,/usr/lib/jvm/java-8-openjdk-amd64/jre,8080 -e --batch-mode -Dmaven.repo.local=/home/sharif/.m2/repository org.apache.maven.plugins:maven-clean-plugin:clean org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:4.2.0-SNAPSHOT:setup

The /opt/apache-maven-3.6.3/bin/ comes from your environment, most likely via the M2_HOME environment variables. So likely, you removed the /opt/apache-maven-3.6.3 folder from your machine, but didn’t reset remove it from the M2_HOME. Note that since Maven 3.5.0, Maven itself doesn’t read the M2_HOME variable, but the version of the Maven Verifier Plugin we use in the integration tests still looks at it to determine where Maven is installed. Most likely just unsetting your M2_HOME variable should get passed that issue.

Thanks @ibacher for detailed clarification, Sure i finally got it building successfully after ressetting my m2_home folder

1 Like

Hello @ibacher @dkayiwa @bistenes , There is still a breakage on Sdk ci pipeline for some good time, SDK - SDK 417: Build result summary - OpenMRS Bamboo, Will be glad to here from you. Thanks .

Hello @bistenes @ibacher . SDK is still failing due to this pull request. Not sure if this is working on your side.

https://issues.openmrs.org/browse/SDK-297

1 Like

Hello @bistenes I kindly request your help on how to fix the compilation error on this SDK module this is the error on the stack trace and my concentration is on. Failing task since return code of [/usr/share/apache-maven-3.3.9/bin/mvn --batch-mode -Djava.io.tmpdir=/home/bamboo-agent/bamboo-agent/.agent_tmp/SDK-SDK-JOB1 clean install] was 1 while expected 0 which I believe me fix the error.