Suddenly can't build the Reference Application module

Hi guys !

I can’t build the reference application module anymore :confused: and I really don’t know what happened.

I tried to build on tags referenceapplication-2.2, referenceapplication-2.3 and on master but none works. Always got the same errors:

Tests in error: testSetupOfProcessHL7Task(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext testAddLoginLocationTagToAtleastOneLocationIfThereAreNoLoginLocations(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext testAddLoginLocationTagToUnknownLocationIfThereAreNoLoginLocations(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext testSetUpAdtGlobalProperties(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext

Tests run: 6, Failures: 0, Errors: 4, Skipped: 0

See the complete build log Ubuntu Pastebin

The CI builds fine

Any ideas ?

1 Like

I’ve tried to delete the maven ~/.m2 directory to let maven re-download all dependencies but problem still appears.

:thumbsup:

Same here, I just cloned it again and mvn install-ed it on a fresh ~/.m2 and it fails on the tests:

Tests in error: 
  testSetupOfProcessHL7Task(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext
  testAddLoginLocationTagToAtleastOneLocationIfThereAreNoLoginLocations(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext
  testAddLoginLocationTagToUnknownLocationIfThereAreNoLoginLocations(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext
  testSetUpAdtGlobalProperties(org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest): Failed to load ApplicationContext

I pasted the full stack trace here: http://paste.ubuntu.com/12999036/

A fix should be in place soon…

Fixed! See https://ci.openmrs.org/browse/RA-RA-1757

I’ve upgraded dependencies.

1 Like

Thanks a lot @raff

Thanks @raff, I can also confirm that everything is back in order!

@raff

Hi again, for info: same problem with coreapps. Even earlier tags would not mvn install anymore (such as 1.6 for instance).

However adding the same dependency on emrapi-api-1.11 in coreapps’s POM does the trick:

  ...
  </dependencies>
</dependencyManagement>

<dependencies>
  <dependency>
    <groupId>org.openmrs.module</groupId>
    <artifactId>emrapi-api-1.11</artifactId>
    <type>jar</type>
  </dependency>
</dependencies>

<build>
  <pluginManagement>
  ...

Perhaps could you commit this as well?

Actually, I have already fixed it in coreapps. Please update to the latest version.

1 Like

Hi @raff,

Now again I can’t build the referenceapplication module on master:

/tmp/openmrs-module-referenceapplication/api/src/main/java/org/openmrs/module/referenceapplication/ReferenceApplicationActivator.java:[30,32] error: package org.openmrs.module.emrapi does not exist

See the log: http://paste.ubuntu.com/13125759/

I’ve tried with maven clean install -U and to delete the ~/.m2/repository/org/openmrs/ without success.

@raff, something that I find a little ‘scary’ here is that suddenly we cannot build projects that were building fine just moments ago. And this without changing anything at all on our end, in particular: not even pulling from any remotes. Surely that should not be the case right?

In a hurry and as a temporary workaround we figured out that when pointing to 2.3 for the distro refapp and 1.12-SNAPSHOT for emrapi-api-1.11, then we could build the refapp module (although while skipping tests).

Shame on me for not checking our CI before the weekend. I’ve fixed it now.

If you setup your project to use any SNAPSHOT dependency then maven will automatically check for updates once in awhile when building. You have no guarantee that your project will continue to build even if you do not make any changes yourself, because they may come from any SNAPSHOT dependency. To avoid that you could either do not depend on SNAPSHOTs or use the -o switch when running maven, which stands for offline.

That said we try to keep our builds green so that you are safe to depend on SNAPSHOTs and we appreciate anyone depending on SNAPSHOTs as it gives us instant feedback if anything fails. We will do our best to address any issues as soon as possible.

1 Like

Right… I thought that this kind of risk was only with LATEST dependencies, but obviously this also happens with SNAPSHOT ones, as we definitely experienced it :wink: Thanks for the -o tip, I didn’t know that. That is very useful to know.

Most of all thanks for fixing the issue and pledging that we should be able to use SNAPSHOT dependencies in the future. And I can confirm that it is working again now!

Thanks @raff