10 , includeTestClasses ? true
16 mvnFlags = lib.escapeShellArgs [
17 "-Dmaven.repo.local=$M2_REPO"
18 (lib.optionalString (!doTest) "-Dmaven.test.skip.exec=true")
23 stdenv.mkDerivation ( {
25 phases = "setupPhase unpackPhase patchPhase mvnCompile ${lib.optionalString doTestCompile "mvnTestCompile mvnTestJar"} ${lib.optionalString doTest "mvnTest"} ${lib.optionalString doJavadoc "mvnJavadoc"} ${lib.optionalString doCheckstyle "mvnCheckstyle"} mvnJar mvnAssembly mvnRelease finalPhase";
30 mkdir -p $out/nix-support
31 export LANG="en_US.UTF-8"
32 export LOCALE_ARCHIVE=$glibcLocales/lib/locale/locale-archive
33 export M2_REPO=$TMPDIR/repository
35 runHook postSetupPhase
39 mvn compile ${mvnFlags}
43 mvn test-compile ${mvnFlags}
47 mvn jar:test-jar ${mvnFlags}
53 if [ -d target/site/cobertura ] ; then
54 echo "report coverage $out/site/cobertura" >> $out/nix-support/hydra-build-products
57 if [ -d target/surefire-reports ] ; then
58 mvn surefire-report:report-only
59 echo "report coverage $out/site/surefire-report.html" >> $out/nix-support/hydra-build-products
64 mvn javadoc:javadoc ${mvnFlags}
65 echo "report javadoc $out/site/apidocs" >> $out/nix-support/hydra-build-products
69 mvn checkstyle:checkstyle ${mvnFlags}
70 echo "report checkstyle $out/site/checkstyle.html" >> $out/nix-support/hydra-build-products
74 mvn jar:jar ${mvnFlags}
78 mvn assembly:assembly -Dmaven.test.skip=true ${mvnFlags}
84 zip=$(ls target/*.zip| head -1)
85 releaseName=$(basename $zip .zip)
86 releaseName="$releaseName-r${toString src.rev or "0"}"
87 cp $zip $out/release/$releaseName.zip
89 echo "$releaseName" > $out/nix-support/hydra-release-name
91 ${lib.optionalString doRelease ''
92 echo "file zip $out/release/$releaseName.zip" >> $out/nix-support/hydra-build-products
97 if [ -d target/site ] ; then
98 cp -R target/site $out/
99 echo "report site $out/site" >> $out/nix-support/hydra-build-products