Best way to give access to .jar file from conda run?

In my pipeline, one of the processes needs a .jar file. It’s included in the docker file used by the process, but I want to make this file accessible to users who are relying on conda/mamba. Unfortunately conda doesn’t natively seem to have a way to download non-package requirements from URLs. Normally I’d just include an extra setup script to download it but I don’t see a way to run such a thing in Nextflow. A third way would be to include the .jar file as a resource when the pipeline itself is downloaded, except I don’t know how I’d make that work for people using the docker image.

Thanks for any advice on how to tackle this challenge.

Hello @bskubi,

There are a number of ways in which you can download assets for pipelines (writing a process for downloading the assets, the beforeScript process directive, etc) and you can do this based (when clause) on the workflow.containerEngine being set and so on (so that it only downloads when you’re not using Singularity or Docker).

Having said all this, unless it’s a very large file, I think the best way to go is to have it together with the pipeline. Some people will run pipelines in offline environments, so they won’t be able to download your jar file on the fly.

except I don’t know how I’d make that work for people using the docker image.

If you don’t want to have it in the pipeline folder and inside the container image, you can have it just in the pipeline folder and provide it as input to the process that uses this container image. Nextflow will make sure to stage the JAR file inside the container.