anchor.diff:      # packages packages that mention this derivation in their buildInputs.
       installPhase = ''
         mkdir -p $out/share/java
  -      ln -s ${jar} $out/share/java/${artifactId}-${version}.jar
  +      ln -s ${jar} $out/share/java/${artifactId_}-${version}${classifier}.jar
       '';
       # We also add a `jar` attribute that can be used to easily obtain the path
       # to the downloaded jar file.
  
positive.code:   jar =
      fetchurl (
        builtins.removeAttrs args ["groupId" "artifactId" "version" "repos" "url" ]
          // { urls = urls_; name = "${name_}.jar"; }
      );
  in
    stdenv.mkDerivation {
  
negative.code: 
  
  let
    classifierSplit =
      with stdenv.lib.strings;
        splitString "$" artifactId;
    artifactId_ = builtins.head classifierSplit;
    classifier =
      with stdenv.lib;
        if builtins.length classifierSplit > 1
        then concatStrings ["-" (builtins.elemAt classifierSplit 1)]
        else "";
    name_ =
      with stdenv.lib; concatStrings [
        (replaceChars ["."] ["_"] groupId) "_"
        (replaceChars ["."] ["_"] artifactId_) "-"
        version
      ];
    mkJarUrl = repoUrl:
      with stdenv.lib; concatStringsSep "/" [
        (removeSuffix "/" repoUrl)
        (replaceChars ["."] ["/"] groupId)
        artifactId_
        version
        "${artifactId_}-${version}${classifier}.jar"
      ];
    urls_ =
      if url != "" then [url]
  