2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchurl
|
|
|
|
, jdk
|
|
|
|
, makeWrapper
|
|
|
|
, callPackage
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
assert jdk != null;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "apache-maven";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.9.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-07-15 17:15:38 +00:00
|
|
|
url = "mirror://apache/maven/maven-3/${finalAttrs.version}/binaries/${finalAttrs.pname}-${finalAttrs.version}-bin.tar.gz";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-/2a3DIMKONMx1E9sJaN7WCRx3vmhYck5ArrHvqMJgxk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/maven
|
|
|
|
cp -r ${finalAttrs.pname}-${finalAttrs.version}/* $out/maven
|
|
|
|
|
|
|
|
makeWrapper $out/maven/bin/mvn $out/bin/mvn \
|
|
|
|
--set-default JAVA_HOME "${jdk}"
|
|
|
|
makeWrapper $out/maven/bin/mvnDebug $out/bin/mvnDebug \
|
|
|
|
--set-default JAVA_HOME "${jdk}"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.buildMavenPackage = callPackage ./build-package.nix {
|
|
|
|
maven = finalAttrs.finalPackage;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2023-07-15 17:15:38 +00:00
|
|
|
mainProgram = "mvn";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Build automation tool (used primarily for Java projects)";
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://maven.apache.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ cko ];
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|