Publishing module artifacts to maven repo

I am creating a module that depend on another module to work, apparently the dependency is NOT yet published to maven repo(configured in pom file), which fails at the end. How can I set my CI to publish those artifacts when the build pass? do I need special privileges to accomplish those? or is there any other places where we can publish those and make a configuration in the pom file? @dkayiwa @darius @raff @ssmusoke @valvijo @pascal @minoneves

You can release a module from your CI to your Bintray account as described at https://wiki.openmrs.org/display/docs/Module+Release

Publishing a SNAPSHOT is also possible (see the 5th step under Setup Bintray account).

Thank yo for quick response @raff. From the documentation it states that I need an account for mavenrepo.openmrs.org which can be requested here http://go.openmrs.org/helpdesk, I will follow those

Are you asking if it’s okay for your CI to publish someone else’s unpublished artifact which is your dependency? (That sounds like bad practice. Or rather, you should ask them first to start publishing it.)

Or are you just talking about publishing the result of your own build?

In short am asking on how my module artifacts can get to openmrs maven repo so that others can depend on it in their pom files for extending on it.

Okay, yes, then you’re following the right path.

Ok, let me see if I get everything right.

Is that correct that we should grant WRITE access to any developer around to both modules and snapshots repositories in our jfrog instance? As in, we allow anyone to deploy any kind of modules, including the ones that are maintained not by the community and don’t belong to our github organisation?

Hence, there will be quite possibly dozens of different CIs which could be writing to our repository.

Is that really what we want? By the wiki page, it seems that no, only our community maintained modules, deployed by our instance of Bamboo, should be deploying modules to openmrs.jfrog.com.

But it appears that we grant write access to anyone who requires.

We used to grant write access to most who requested it, but it’s too much on us to manage as we grow. The way forward is to suggest everyone to use free Bintray service, whereas openmrs.jfrog.com should be reserved only for community managed modules available at github.com/openmrs. It’s described on the wiki page I’ve linked.

1 Like

I gave bintray a shot but am getting this error when I do mvn release:perform

This my scm and this my repostory. Anywhere am going wrong? Here is my entire pom file

Could you please try adding

  	<repository>
  		<id>bintray-ningosi-maven</id>
  		<name>ningosi-maven</name>
  		<url>https://dl.bintray.com/ningosi/maven</url>
  	</repository>

under repositories in your pom?

Still with this trick, did NOT work out, the error remained the same

Any chance you could get us the full log? That tends to be easier to spot the problem.

When I do mvn release:prepare -X this the error https://pastebin.com/0jhiymS5

Can you share the full build log? Including the command that you are running.

1 Like