Command line installing a plugin for Travis CI

Is there a way to install a plugin through the command line without spinning up ImageJ? I am using Travis CI to test code that calls ImageJ through Python, but one of the tests uses a non-default plugin (BigStitcher).

My script has Travis download a Fiji installation, but I don’t know how to tell it to add the plugin. Do I need to manually download the correct jar and then unpack it to the plugins directory, or is there a better way of doing this?

For reference, here’s the bash script (courtesy of @ctrueden) that downloads the Fiji installation.

  echo
  echo "--> Downloading Fiji"
  curl -fsO http://downloads.imagej.net/fiji/latest/fiji-nojre.zip

  echo "--> Unpacking Fiji"
  rm -rf Fiji.app
  unzip fiji-nojre.zip

Yes, you can use the command-line Updater.

Here is an example invocation that adds the LOCI update site and installs the plugins from there:

./ImageJ-linux64 --update edit-update-site LOCI https://sites.imagej.net/LOCI/
./ImageJ-linux64 --update update

You can verify the status with:

./ImageJ-linux64 --update list-from-site LOCI

Replace LOCI with whatever site you want. Unfortunately, even for the “List of update sites” sites like LOCI, you will need to recapitulate the URL in the edit-update-site command in order to enable it.

Note the use of https://sites.imagej.net/ rather than plain HTTP. This should work (and is preferred) as long as the version of Java is 1.8.0_101 or newer.

6 Likes

Thanks @ctrueden. I had looked, but missed it in the obvious place.

Unfortunately, the commands didn’t seem to load properly in Travis. I haven’t been able to check in depth though - in part due to it failing before it even gets to the tests, but I will report back if I and when I do.

A note for windows users reading this thread: there are currently issues calling functions like these in Windows. I was testing the commands on my windows desktop and had to add --console or --debug in order to get them to work.

I know this is old, but I just came across this… super useful!

I ran into an issue with this on macOS. Everything seemed to be going fine (adding update sites) until I ran:

ImageJ-macosx --update update

It completed without error, but then I got the “app needs to be updated error” and the X over the Fiji icon (suggesting 32bit app?) and have to reinstall Fiji … thoughts?

Screen Shot 2020-11-26 at 12.36.27 PM