Maintaining SNAPSHOT Maven dependencies

Thanks @mksd for bringing it back to this… I did indeed suggest we keep the snapshots of the reference application module around, at least until we come up with a better solution:

Any objections to setting this up? Any does anyone know how to configure the repo to set this up? :slight_smile:

Take care, Mark

2 Likes

I approve of making this change (just for the distro). I don’t know how to do it though.

-Darius (by phone)

Anyone know how to do this? @michael is this a help desk ticket?

I looked quickly and didn’t see an obvious way to do it–I may not have admin rights n the repo though.

Mark

Hi @bholagabbar @mogoodrich @cintiadr and everyone else involved in this thread. We would like to discuss this topic on the May 26th dev forum would you all be able to join the call?

1 Like

Since this is an engineering policy decision, I’d encourage us to keep the conversation here where everyone has the opportunity to participate and provide feedback, rather than doing it on a phone call with very limited participation.

Who is the person that has the final decision about how to proceed with version retention?

@michael, I don’t think there’s much further to discuss, as far as policy goes.

We have basically decided to try this quick fix. I will own this decision (as former RefApp lead, without any replacement at this point).

The question is, can we retain SNAPSHOT versions of org.openmrs.distro.referenceapplication in maven, without retaining snapshots of all the other artifacts? And who can configure this?

It looks like Neuxs currently has a configuration for a scheduled task of “Remove Snapshots from Repository” which runs hourly. Related, there is an “Empty Trash” job which runs daily.

Based on https://books.sonatype.com/nexus-book/reference/scheduled-tasks.html, the remove snapshot can only work on a repository level; in this case, our entire “Snapshots” repository at http://mavenrepo.openmrs.org/nexus/content/repositories/snapshots/. We have configured a minimum snapshot count of 1. I do not see any documentation for such a job that can exclude specific snapshots, without moving those specific files to a separate repository altogether.

However, there is also a “Remove Unused Snapshots From Repository” job available, that would restrict only to unused snapshots. I’m not sure how exactly this is measured, or if it would work for this scenario.

Scheduled tasks can be adjusted by any user with the “Nexus Administrator” role, which currently includes: Burke, Daniel, Darius, Fred Chen, Matt Blanchette, Mayank, Rowan Seymour, & Saptarshi.

Seems like it might make sense to:

  1. Make sure the “Remove Snapshots” task is not running on our “modules” repo

  2. Change the pom of the distro module to publish snapshots to the “modules” repo

I don’t know enough about Maven / Nexus to know if they’d be any issues with this.

This is the case … only runs against the “Snapshots” repo. Not sure if #2 is viable but hopefully someone can chime in.

I figured it might be as simple as in the pom changing:

        <snapshotRepository>
            <id>openmrs-repo-snapshots</id>
            <name>OpenMRS Snapshots</name>
            <url>http://mavenrepo.openmrs.org/nexus/content/repositories/snapshots</url>
        </snapshotRepository>

to:

<snapshotRepository>
        <id>openmrs-repo-modules</id>
        <name>Modules</name>
        <url>http://mavenrepo.openmrs.org/nexus/content/repositories/modules</url>
 </snapshotRepository>

But when I changed this and did a mvn clean deploy I got this message:

ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project referenceapplication: Failed to deploy artifacts: Could not transfer artifact org.openmrs.distro:referenceapplication:pom:2.4-20160503.182542-1 from/to openmrs-repo-modules (http://mavenrepo.openmrs.org/nexus/content/repositories/modules): Failed to transfer file: http://mavenrepo.openmrs.org/nexus/content/repositories/modules/org/openmrs/distro/referenceapplication/2.4-SNAPSHOT/referenceapplication-2.4-20160503.182542-1.pom. Return code is: 400, ReasonPhrase: Bad Request. -> [Help 1]

@darius is this still a topic you would like to discuss on a dev forum? If yes do we want to shoot for this month or next?

@jthomas, no this is not a dev-forum-worthy topic.

-Darius

1 Like

it came up during topic fest so thanks for the heads up. i will remove it from the list.

Does anyone have any further thoughts on #2 above? (See my last comment).

1 Like

@jthomas, what aspect of this conversation came up during the topic fest?