Unverified Commit 90b1967e authored by Arnout Engelen's avatar Arnout Engelen Committed by GitHub
Browse files

Merge pull request #292323 from Baltoli/maven-sources

maven: allow dependency sources to be stored in fixed-output derivation
parents 715f3a0a bd91833e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
, mvnFetchExtraArgs ? { }
, mvnDepsParameters ? ""
, manualMvnArtifacts ? [ ]
, manualMvnSources ? [ ]
, mvnParameters ? ""
, ...
} @args:
@@ -39,6 +40,14 @@ let
        echo "downloading manual $artifactId"
        mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2
      done

      for artifactId in ${builtins.toString manualMvnSources}
      do
        group=$(echo $artifactId | cut -d':' -f1)
        artifact=$(echo $artifactId | cut -d':' -f2)
        echo "downloading manual sources $artifactId"
        mvn dependency:sources -DincludeGroupIds="$group" -DincludeArtifactIds="$artifact" -Dmaven.repo.local=$out/.m2
      done
    '' + lib.optionalString (!buildOffline) ''
      mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters}
    '' + ''