Unable to deploy RefApp 3 release

I’m a little stuck on this build trying to release the 3.x RefApp. Specifically, the build is failing at this:

error	16-Mar-2023 15:45:10	#19 63.34 Uploading to openmrs-repo-releases: https://openmrs.jfrog.io/artifactory/releases/org/openmrs/distro/referenceapplication/3.0.0-beta.4/referenceapplication-3.0.0-beta.4.pom
error	16-Mar-2023 15:45:10	#19 63.62 Progress (1): referenceapplication-3.0.0-beta.4.pom (4.1/6.1 kB)
error	16-Mar-2023 15:45:10	Progress (1): referenceapplication-3.0.0-beta.4.pom (6.1 kB)    
error	16-Mar-2023 15:45:11	                                                            
error	16-Mar-2023 15:45:11	[INFO] ------------------------------------------------------------------------
error	16-Mar-2023 15:45:11	#19 63.75 [INFO] Reactor Summary for Package and Run OpenMRS 3.0.0-beta.4:
error	16-Mar-2023 15:45:11	#19 63.75 [INFO] 
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] Package and Run OpenMRS ............................ FAILURE [ 41.999 s]
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] OpenMRS distro ..................................... SKIPPED
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] ------------------------------------------------------------------------
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] BUILD FAILURE
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] ------------------------------------------------------------------------
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] Total time:  42.945 s
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] Finished at: 2023-03-16T15:45:10Z
error	16-Mar-2023 15:45:11	#19 63.76 [INFO] ------------------------------------------------------------------------
error	16-Mar-2023 15:45:11	#19 63.78 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0:deploy (default-deploy) on project referenceapplication: Failed to deploy artifacts: Could not find artifact org.openmrs.distro:referenceapplication:pom:3.0.0-beta.4 in openmrs-repo-releases (https://openmrs.jfrog.io/artifactory/releases) -> [Help 1]
error	16-Mar-2023 15:45:11	#19 63.78 org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0:deploy (default-deploy) on project referenceapplication: Failed to deploy artifacts: Could not find artifact org.openmrs.distro:referenceapplication:pom:3.0.0-beta.4 in openmrs-repo-releases (https://openmrs.jfrog.io/artifactory/releases)
error	16-Mar-2023 15:45:11	#19 63.79     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375)
error	16-Mar-2023 15:45:11	#19 63.80     at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
error	16-Mar-2023 15:45:11	#19 63.80     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:298)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
error	16-Mar-2023 15:45:11	#19 63.81     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
error	16-Mar-2023 15:45:11	#19 63.82     at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
error	16-Mar-2023 15:45:11	#19 63.82     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
error	16-Mar-2023 15:45:11	#19 63.82     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
error	16-Mar-2023 15:45:11	#19 63.82     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
error	16-Mar-2023 15:45:11	#19 63.82     at java.lang.reflect.Method.invoke (Method.java:498)
error	16-Mar-2023 15:45:11	#19 63.82     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
error	16-Mar-2023 15:45:11	#19 63.82     at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
error	16-Mar-2023 15:45:11	#19 63.82     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
error	16-Mar-2023 15:45:11	#19 63.82     at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
error	16-Mar-2023 15:45:11	#19 63.82 Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not find artifact org.openmrs.distro:referenceapplication:pom:3.0.0-beta.4 in openmrs-repo-releases (https://openmrs.jfrog.io/artifactory/releases)
error	16-Mar-2023 15:45:11	#19 63.82     at org.apache.maven.plugins.deploy.AbstractDeployMojo.deploy (AbstractDeployMojo.java:175)

The same job using the same image, etc., but building a non-snapshot version releases correctly. In fact, the file it uploads seems to be correctly created.

Any ideas what I might be missing? cc: @dkayiwa @raff

As far as I can make out, it’s something to do with the releases repo in JFrog itself. If I change it to contrib it seems to deploy as expected.

The build steps are green now. Is this resolved then?

No… I just changed the build from running deploy to running install so we’d at least have a Docker image.

The error message may be misleading and it may not be able to deploy, because the file exists. Have you tried deleting the file and re-running?

I’m taking a slightly different approach for other release jobs. I simply run mvn deploy using the dev image. It is slightly easier to manage, because if you first run install, you are sure that everything builds fine and can be deployed in a consecutive stage. If you just run deploy and the build fails, but some artifacts have been already pushed to the repo, then in order to re-run you need to go to the maven repo and delete those artifacts manually. See e.g. openmrs-core/bamboo.yml at 9ddc7d6a0e00d75cedf979484d3c057def0e4f90 · openmrs/openmrs-core · GitHub

Yes, I did try that. In fact, I had done that originally with -beta.3 and then bumped to -beta.4 just in case it was file caching gremlins or something.

Interesting. I could adopt that, though it would mean changing the build process and actually doing something with the dev stage (right now, we use the core dev image to actually run the build, but don’t retain it afterwards. We’re basically run running the SDK’s setup command and creating a zip archive of the distro/configuration directory, then copying the SDK output to the runtime image. The nice feature about our current build setup is that it basically does what we tell user’s to do in the README.