Create homebrew formula for easy installation on OSX

Issue #6 resolved
Andrew S created an issue

It seems fairly easy to add a formula to homebrew.

This would increase the uptake of mvnvm by lazy OSX users like me.

Comments (8)

  1. Andrew S Account Deactivated reporter

    This formula I wrote seems to do the job:

    require "formula"
    
    # Homebrew formula to install mvnvm, the Maven Version Manager, see http://mvnvm.org
    
    class Mvnvm < Formula
      homepage "http://mvnvm.org"
      url "https://bitbucket.org/mjensen/mvnvm/get/master.tar.gz"
      version "0.1"  # Bump this when master contains a change to distribute
      sha1 "8a005f44895844f4d705cdaaf27104f16e752482" # brew install tells us if wrong or missing
    
      def install
        bin.install "mvn" # Sets the executable flag for us
        ohai "If you previously installed mvnvm manually, please remove it using `rm -f ~/bin/mvn`"
        ohai "And if you have any other Maven installations on your path, remove them too."
        ohai ""
        ohai "Running `mvn -version` should now output something like `[MVNVM] Using maven: x.y.z`, etc."
      end
    
      conflicts_with 'maven',
        :because => 'instead of installing Maven via Homebrew, you should use mvnvm to manage your Maven versions.'
    
      test do
        # Run the test with `brew test mvnvm`
        system "mvn", "-version"
      end
    end
    

    It tells Homebrew to install the latest archive from the master branch as version 0.1. Homebrew will download the latest version whenever we bump the synthetic version number in this formula.

    @mjensen, are you happy for me to submit a PR to the Homebrew folks?

  2. Andrew S Account Deactivated reporter

    I don't seem to be able to assign this issue to myself, happy for anyone else to do that.

  3. mjensenbitbucket-bot repo owner

    I have changed the permissions so this issue can be assigned to you. Go ahead and PR the formula to brew!

  4. Log in to comment