Unverified Commit 4ec7cd46 authored by Thibault Gagnaux's avatar Thibault Gagnaux
Browse files

buildMavenPackage: hide offline build behind feature flag

The feature flags allows for packages to opt in and should not
break current packages.
parent 9a7693b7
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

{ src
, sourceRoot ? null
, buildOffline ? false
, patches ? [ ]
, pname
, version
@@ -28,7 +29,9 @@ let
      maven
    ];

    buildPhase = ''
    buildPhase =
      if buildOffline
      then ''
        runHook preBuild

        mvn dependency:go-offline -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}
@@ -39,6 +42,13 @@ let
          mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2
        done

        runHook postBuild
      ''
      else ''
        runHook preBuild

        mvn package -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters}

        runHook postBuild
      '';