summary refs log blame commit diff
path: root/pkgs/development/java-modules/m2install.nix
blob: 88e8efca1a159313c89a0706d217f7e10ea48e0b (plain) (tree)
1
2
3
4
5
6
7
                     
                                                                  



                                               
                                      













                                                 
{ stdenv, fetchurl }:
{ version, baseName, package, sha512, type ? "jar", suffix ? "" }:

let
  name = "${baseName}-${version}";
  m2Path = "${package}/${baseName}/${version}";
  m2File = "${name}${suffix}.${type}";
  src = fetchurl rec {
      inherit sha512;
      url = "mirror://maven/${m2Path}/${m2File}";
  };
in stdenv.mkDerivation rec {
  inherit name m2Path m2File src;

  installPhase = ''
    mkdir -p $out/m2/$m2Path
    cp $src $out/m2/$m2Path/$m2File
  '';

  phases = "installPhase";
}