glitch starting with openmrs-core

5 views
Skip to first unread message

a platypus

unread,
Feb 16, 2015, 7:15:08 AM2/16/15
to d...@openmrs.org
hi folks,

I'm just another new starter launching my canoe onto one of the tributaries of the OpenMRS river.  To date, I've read over the several introductory /starter material and watched the OpenMRS university YouTube on building core and building a module.  On an earlier attempt something on my PC's set-up created bother with the Standalone app (topic: OpenMRS 2.1 Standalone).

Following the lead of the Youtube video, I wanted to build the OpenMRS-core.  I took a snapshot from GitHub on the weekend and concentrated on using  Maven builds.   Anyway I had some trip-hazards simply building the "out of the box" master-zip of the project. 

The "openmrs-tools" sub-project won't build because it is missing <version>-tag for the "maven-surefire-plugin" (testing):

The surefire version property is actually in the superordinate, main POM file, not the tools POM file

For the purpose of the exercise, I used the most recent surefire release:

  • $ openmrs-core/blob/master/pom.xml
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
            <failIfNoTests>false</failIfNoTests>
        </configuration>
        <version>2.18</version>
    </plugin>

Then:
mvn install

Success.  I thought it is worth letting people looking at the project tree, because the POM file/project with the 'problem' isn't where the source /solution is to be found.  This is a really neat Maven feature really but it has bitten me before, so I went looking.
To save time, I opened the project with Netbeans.  It is showing "Unresolved project problems", after a Maven build-with-dependencies, and some Maven updates and downloads, the bulk of these were resolved.  But it's not done yet; so far so good.

I put some added detail in for other new-comers like me, who might strike similarly odd issues.

My main question is how come the Master from GitHub has a basic flaw?  Or, more relevantly, is there something else I "should have done" but didn't that would have avoided that surefire version problem?

At least I'm getting some where.  Hope to hear back on this topic though.  I'm sure I'll have more learning when everything "resolves themselves" :-)

Kind regards,

   Will

Rafal Korytkowski

unread,
Feb 16, 2015, 7:45:09 AM2/16/15
to Developers List
Hi Will,

Thanks for reporting the issue. It is something specific to your environment that triggers the error, because we do not observe any issues at https://ci.openmrs.org/browse/TRUNK-MASTER/latest and nothing similar is reported by other devs.

Please let us know what are your java & maven versions and pastebin the output from: mvn dependency:resolve-plugins


-Rafał

--
OpenMRS Developers: http://om.rs/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions: http://om.rs/id
 
Visit OpenMRS Talk at http://om.rs/talk for chat and discussions!

a platypus

unread,
Feb 16, 2015, 3:45:42 PM2/16/15
to d...@openmrs.org
G'day Rafał,

Thanks for setting me straight.  I 'thought' it should build without my help.  Looking more carefully I see there's surefire plugins also in plugin management.  OK

I took out the "version change" and re-did the build with the 'make-all' option:

mvn install  --am

And, build success. 

The system is Windows 7 64-bit, compiler is: jdk v1.6 u45 64-BIT.  I have attached the plug-in dependency output too, but the issues seems to be ensuring the local repository actually downloaded (all) the dependent bits.  Good to know it was my error/omission.

Many thanks,

   Will
mvn-resolve-dependencies.lst

Cintia Del Rio

unread,
Feb 16, 2015, 7:45:29 PM2/16/15
to OpenMRS Developer List
That's absolutely unexpected. The master pom defines surefire version in PluginManagement, so it's inherited for the tool pom.

It should work out of the box.

A few things I will ask you:
   - mvn help:effective-pom
   - mvn --version
   - If you have a ~/.m2/settings.xml file, please attach it (exclude any passwords first!). Looks like you have a localhost nexus, I'm not sure what's that.
  - You should have a few metadata files in ~/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata-* . It would be interesting to see them (ignore the sha1 files)
  - Lastly, you can try to remove ~/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/ and see how it behaves to a 'mvn clean install -DskipTests'. For the sake of the exercise, 'mvn -u clean install -DskipTests' might be useful as well.




 

--
OpenMRS Developers: http://om.rs/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions: http://om.rs/id
 
Visit OpenMRS Talk at http://om.rs/talk for chat and discussions!

To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@openmrs.org.



--
-------
Sent from TARDIS. Typos might be a timey whyney thingy.
Enviado da TARDIS, podem existir erros devido à diferenças de espaço-tempo.
 
Cintia Del Rio

a platypus

unread,
Feb 17, 2015, 3:48:26 PM2/17/15
to d...@openmrs.org
Hi Cintia,

Thanks for your post.  That initial issue with surefire seems to be OK since I used the -am switch but I'm still having bother.  I removed the project folder and did a fresh unzip from the mrs-core-master.  The api project still won't build.

Tthe mvn -version is:

mvn -version
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T06:58:10+10:00)
Maven home: b:\repository\maven\v03.02
Java version: 1.6.0_45, vendor: Sun Microsystems Inc.
Java home: b:\lang\java\jdk\v1.6\u45\x64\jre
Default locale: en_AU, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"


I have attacked the effective POM output and the MVN settings file:
  • mvn-effective-pom.lst
  • settings.xml

My issue seems to be finding repositories.  I hve the un-modified master of the project, no changes, so I'm curious where my set-up has skipped some stuff.
  • org.azeckoski:reflectutils:jar:0.9.14
  • org.openmrs.simpleframework:simple-xml:jar:1.6.1-mod
  • org.openmrs.hibernate:hibernate-core:jar:3.6.5.Final-mod
  • org.openmrs.liquibase.ext:modify-column:jar:2.0.2
  • org.openmrs.liquibase.ext:identity-insert:jar:1.2.1
  • org.openmrs.liquibase.ext:type-converter:jar:1.0.1
Are there some some instructions for how to set-up for those?

Then did a fresh build:

[INFO] Building openmrs-api 1.12.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.azeckoski:reflectutils:jar:0.9.14 is missing, no dependency information available
[WARNING] The POM for org.openmrs.simpleframework:simple-xml:jar:1.6.1-mod is missing, no dependency information available
[WARNING] The POM for org.openmrs.hibernate:hibernate-core:jar:3.6.5.Final-mod is missing, no dependency information available
[WARNING] The POM for org.openmrs.liquibase.ext:modify-column:jar:2.0.2 is missing, no dependency information available
[WARNING] The POM for org.openmrs.liquibase.ext:identity-insert:jar:1.2.1 is missing, no dependency information available
[WARNING] The POM for org.openmrs.liquibase.ext:type-converter:jar:1.0.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] OpenMRS ............................................ SUCCESS [  1.159 s]
[INFO] openmrs-tools ...................................... SUCCESS [  0.393 s]
[INFO] openmrs-test ....................................... SUCCESS [  0.124 s]
[INFO] openmrs-api ........................................ FAILURE [  0.298 s]
[INFO] openmrs-web ........................................ SKIPPED
[INFO] openmrs-webapp ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.291 s
[INFO] Finished at: 2015-02-18T07:26:51+11:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project openmrs-api: Could not resolve dependencies for project org.openmrs.api:openmrs-api:jar:1.12.0-SNAPSHOT: The following artifacts could not be resolved: org.azeckoski:reflectutils:jar:0.9.14, org.openmrs.simpleframework:simple-xml:jar:1.6.1-mod, org.openmrs.hibernate:hibernate-core:jar:3.6.5.Final-mod, org.openmrs.liquibase.ext:modify-column:jar:2.0.2, org.openmrs.liquibase.ext:identity-insert:jar:1.2.1, org.openmrs.liquibase.ext:type-converter:jar:1.0.1: Failure to find org.azeckoski:reflectutils:jar:0.9.14 in http://localhost:8022/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR]


Hopefully one of you wise people can point out the missing areas?  My thanks in advance.

Kind regards,

  Will
mvn-effective-pom.lst
settings.xml

Cintia Del Rio

unread,
Feb 17, 2015, 5:47:11 PM2/17/15
to OpenMRS Developer List
I will be looking it properly tomorrow, but why do have that settings file?
It complicates a lot things, as you are proxing maven central using a local nexus instance. Also, I'm not sure why you would define josql-app-profile and jsf-app-profile profiles.

First thing I'd try is to delete/rename the settings file, so maven won't use it (you shouldn't need a settings file nor a nexus proxy when developing openmrs core). Stop your localhost nexus instance as well.

If you are planning on having a more complex infra (nexus proxing several different maven repositories) it's possible, as well as it's possible to define the repositories in the pom file. The settings file is not really the best approach for that, and looks like it's affecting other builds as the profiles are always activated. 

Kris Schmidt

unread,
Feb 17, 2015, 5:50:59 PM2/17/15
to d...@openmrs.org, d...@openmrs.org
Will, can you try temporarily removing / renaming your ~/.m2/settings.xml and then running the build?

I suspect your localhost nexus setup is somehow interfering. If you take settings.xml out of the picture then you will be doing a more clean out of the box build.
<mvn-effective-pom.lst>
<settings.xml>

* William

unread,
Feb 19, 2015, 7:24:34 AM2/19/15
to d...@openmrs.org
Hi ...

Actually the most important comment is that the project builds elsewhere.  I have unrolled maven changes and re-rolled them, and I ran the bundled maven that comes with Netbeans (which worked) and compared those settings with the current file.

OpenMRS now builds for me, with both installed maven 3 and the bundled Netbeans.  Many thanks for pushing me in the right direction.

It might take a long time to decipher what was going amiss with the settings.  In comparing, I found "loose" (unpaired) XML tags that maven didn't barf on; but that ... probably confused the heck out of it.

I have build, building.  The test report that they  run OK.  I found some exceptions reported in the maven output, so I'm planning to investigate those.   Best way to learn about code is to follow-up problems.

It would be good to know though if any know exceptions are in the tests, such as:
  • NullPointerExceptions ... EncounterSaveHandlerTest
As either as a deliberate "test" or known issue(s).

And of course I'm looking forward to running the app!   Happy New Lunar Year!

Kind regards,

:-)
Reply all
Reply to author
Forward
0 new messages