Failing to Build OpenMRS 2.4.0-SNAPSHOT due to a maven Error

Sorry for late reply thanks @dkayiwa @mozzy for picking up on this

yes @dkayiwa I deleted all the files in C:\Users\Insookwa.m2\repository

@mozzy my system Environments point here. JAVA_HOME :C:\Program Files\Java\jdk1.8.0_241 M2_HOME:C:\Users\Insookwa\apache-maven-3.6.3 MAVEN_HOME:C:\Users\Insookwa\apache-maven-3.6.3

Can you try add the dependencies mentioned here and see if it helps? https://stackoverflow.com/questions/18442753/a-required-class-was-missing-while-executing-org-apache-maven-pluginsmaven-war

2 Likes

Thanks @dkayiwa . the solution in the link suggests adding some plugins. i am still getting the same. I’ve also built a simple maven project and used those plugins in the pom.xml file but still when I try to maven clean install -U it throws the same Error.

do you think I should consider deleting the whole maven setup and reconfigure it

This is the error log https://pastebin.com/U0MRQX5j

No need to first ask for permission. :smile:

1 Like

@insookwa, How far with your challenge? Is it solved

not yet @gracebish i have not yet succeeded . i have tried out a lot of solutions on stack overflow and still trying to figure out the problem.

@insookwa, Please check whether you have pom files in your directory. Find out whether your branch is up to date. If you do not have the pom file in any of your projects, try to right click your project -> Maven-> Update project -> Force update snapshots/ releases-> ok. You may live your project to build even if it does not show anything for about two hours then check again to see whether the pom file has been imported. Sometimes, it takes time. Don’t forget to leave your git bash window open as well.

1 Like

thanks @gracebish . I have tried it all and it didn’t make a change . for some reason all my maven projects cant build . when I run mvn clean install -U , everything breaks at this

[WARNING] Error injecting: org.apache.maven.plugin.resources.ResourcesMojo java.lang.NoClassDefFoundError: org/apache/maven/shared/filtering/MavenFilteringException

Do you have POM in your project? or you change the directory for your project.

yes @gracebish in the openMRS files, there are POM.xml files in the core,api,quibase,test,tools,web and webapp folders. even in my other projects files, I have the pom.xml to handle dependencies and other stuff

if it show that your branch is up to date, just leave your windows for Eclipse and git bash open for about five hours and then run the mvn clean install again and see

1 Like

I had the same struggle last week. Just be patient it will eventually build

@insookwa are you available such that we pair to fix this from? https://www.uberconference.com/openmrs

1 Like

oh Thanks, @dkayiwa.i have just seen this late. I am available all through and I will be glad.

I’ve recently tried to build openmrs-module-fhir2 and it also breaks at the same point Logs here : https://pastebin.com/sdW1PKuk . I confirm the problem is on Maven

i have used another computer and changed from maven 3.6.3 to 3.6.1 . this time it has tried to build but failed at this point with this error : full log here :https://pastebin.com/Hy3cmpX4

what could be the problem @mozzy @sharif @dkayiwa

[INFO] [INFO] Results: [INFO] [ERROR] Failures: [ERROR] ConceptServiceTest.saveConcept_shouldSetAuditInfoIfAnItemIsRemovedFromAnyOfItsChildCollections:2524 expected: but was: [INFO] [ERROR] Tests run: 4314, Failures: 1, Errors: 0, Skipped: 38 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary for OpenMRS 2.4.0-SNAPSHOT: [INFO] [INFO] OpenMRS … SUCCESS [ 1.748 s] [INFO] openmrs-tools … SUCCESS [03:43 min] [INFO] openmrs-test … SUCCESS [06:22 min] [INFO] openmrs-api … FAILURE [46:06 min] [INFO] openmrs-web … SKIPPED [INFO] openmrs-webapp … SKIPPED [INFO] openmrs-liquibase … SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------

Can you first skip Tests first. mvn clean install -DskipTests. and see if it runs successfully, share the logs after

1 Like

Build successful at at last :man_dancing: :man_dancing: thanks @sharif @mozzy @dkayiwa @gracebish

maybe for someone who may get it again i used switched from maven 3.6.3 to 3.6.1 . (even when i changed computer maven 3.6.3 threw the same error at the same point )

and then skipping Tests as recommended by @sharif and then built successfully full logs here : https://pastebin.com/WWVsk5bW

1 Like

Congrats :+1:, however we just skipped tests, so we ran part of core skipping tests, can you try again mvn clean install -U make sure you are on stable internet

1 Like