Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/jacoco.xml ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/jacoco.xml (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/jacoco.xml Thu Jan 11 01:05:54 2018 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd"><report name="Apache Commons Release Plugin"><sessioninfo id="Robs-iMac-Pro.local-fe3fc51d" start="1515632647694" dump="1515632650243"/><package name="org/apache/commons/release/plugin/mojos"><class name="org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo"><method name="<init>" desc="()V" line="53"><counter type="INSTRUCTION" missed="0" covered="3"/><counter type="LINE" missed="0" covered="1"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="execute" desc="()V" line="114"><counter type="INSTRUCTION" missed="152" covered="120"/><counter type="BRANCH" missed="7" covered="3"/><counter type="LINE" missed="18" covered="22"/><counter type="COMPLEXITY" missed="5" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="copyReleaseNotesToWork ingDirectory" desc="()V" line="177"><counter type="INSTRUCTION" missed="0" covered="45"/><counter type="LINE" missed="0" covered="8"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="copyDistributionsIntoScmDirectoryStructure" desc="()Ljava/util/List;" line="210"><counter type="INSTRUCTION" missed="50" covered="89"/><counter type="BRANCH" missed="2" covered="6"/><counter type="LINE" missed="6" covered="15"/><counter type="COMPLEXITY" missed="2" covered="3"/><counter type="METHOD" missed="0" covered="1"/></method><method name="buildDistBinariesRoot" desc="()Ljava/lang/String;" line="244"><counter type="INSTRUCTION" missed="0" covered="14"/><counter type="LINE" missed="0" covered="3"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="buildDistSourceRoot" desc="()Ljava/lang/String;" line="256"><counter type="INSTRUCTION" missed="0" covered="14"/ ><counter type="LINE" missed="0" covered="3"/><counter type="COMPLEXITY" >missed="0" covered="1"/><counter type="METHOD" missed="0" >covered="1"/></method><method name="setBasedir" desc="(Ljava/io/File;)V" >line="269"><counter type="INSTRUCTION" missed="0" covered="4"/><counter >type="LINE" missed="0" covered="2"/><counter type="COMPLEXITY" missed="0" >covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><counter >type="INSTRUCTION" missed="202" covered="289"/><counter type="BRANCH" >missed="9" covered="9"/><counter type="LINE" missed="24" >covered="54"/><counter type="COMPLEXITY" missed="7" covered="9"/><counter >type="METHOD" missed="0" covered="7"/><counter type="CLASS" missed="0" >covered="1"/></class><class >name="org/apache/commons/release/plugin/mojos/CommonsDistributionDetachmentMojo"><method > name="<init>" desc="()V" line="48"><counter type="INSTRUCTION" >missed="0" covered="8"/><counter type="LINE" missed="0" covered="2"/><counter >type="COMPLEXITY" missed="0" cove red="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="execute" desc="()V" line="93"><counter type="INSTRUCTION" missed="0" covered="64"/><counter type="BRANCH" missed="0" covered="8"/><counter type="LINE" missed="0" covered="14"/><counter type="COMPLEXITY" missed="0" covered="5"/><counter type="METHOD" missed="0" covered="1"/></method><method name="copyRemovedArtifactsToWorkingDirectory" desc="()V" line="119"><counter type="INSTRUCTION" missed="0" covered="59"/><counter type="BRANCH" missed="0" covered="2"/><counter type="LINE" missed="0" covered="11"/><counter type="COMPLEXITY" missed="0" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><method name="sha1AndMd5SignArtifacts" desc="()V" line="140"><counter type="INSTRUCTION" missed="16" covered="92"/><counter type="BRANCH" missed="0" covered="4"/><counter type="LINE" missed="2" covered="16"/><counter type="COMPLEXITY" missed="0" covered="3"/><counter type="METHOD" missed="0" covered="1"/> </method><method name="getMd5FilePath" desc="(Ljava/io/File;Ljava/io/File;)Ljava/lang/String;" line="169"><counter type="INSTRUCTION" missed="0" covered="22"/><counter type="LINE" missed="0" covered="5"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="getSha1FilePath" desc="(Ljava/io/File;Ljava/io/File;)Ljava/lang/String;" line="184"><counter type="INSTRUCTION" missed="0" covered="22"/><counter type="LINE" missed="0" covered="5"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="<clinit>" desc="()V" line="59"><counter type="INSTRUCTION" missed="0" covered="24"/><counter type="LINE" missed="0" covered="7"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="16" covered="291"/><counter type="BRANCH" missed="0" covered="14"/><counter type="LINE" mis sed="2" covered="60"/><counter type="COMPLEXITY" missed="0" covered="14"/><counter type="METHOD" missed="0" covered="7"/><counter type="CLASS" missed="0" covered="1"/></class><class name="org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo"><method name="<init>" desc="()V" line="46"><counter type="INSTRUCTION" missed="0" covered="3"/><counter type="LINE" missed="0" covered="1"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="execute" desc="()V" line="77"><counter type="INSTRUCTION" missed="33" covered="38"/><counter type="BRANCH" missed="1" covered="3"/><counter type="LINE" missed="5" covered="9"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><method name="getAllSiteFiles" desc="(Ljava/io/File;Ljava/util/List;)V" line="107"><counter type="INSTRUCTION" missed="4" covered="27"/><counter type="BRANCH" missed="1" covered="3"/><counter type="LINE" missed="1" covered="5"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><method name="writeZipFile" desc="(Ljava/io/File;Ljava/io/File;Ljava/util/List;)V" line="128"><counter type="INSTRUCTION" missed="0" covered="42"/><counter type="BRANCH" missed="1" covered="3"/><counter type="LINE" missed="0" covered="9"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><method name="addToZip" desc="(Ljava/io/File;Ljava/io/File;Ljava/util/zip/ZipOutputStream;)V" line="150"><counter type="INSTRUCTION" missed="0" covered="45"/><counter type="BRANCH" missed="0" covered="2"/><counter type="LINE" missed="0" covered="11"/><counter type="COMPLEXITY" missed="0" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="37" covered="155"/><counter type="BRANCH" missed="3" covered="11"/><counter type="LINE" missed="6" covered="35"/> <counter type="COMPLEXITY" missed="3" covered="9"/><counter type="METHOD" missed="0" covered="5"/><counter type="CLASS" missed="0" covered="1"/></class><sourcefile name="CommonsDistributionDetachmentMojo.java"><line nr="48" mi="0" ci="2" mb="0" cb="0"/><line nr="59" mi="0" ci="4" mb="0" cb="0"/><line nr="60" mi="0" ci="4" mb="0" cb="0"/><line nr="61" mi="0" ci="4" mb="0" cb="0"/><line nr="62" mi="0" ci="4" mb="0" cb="0"/><line nr="63" mi="0" ci="4" mb="0" cb="0"/><line nr="64" mi="0" ci="3" mb="0" cb="0"/><line nr="65" mi="0" ci="1" mb="0" cb="0"/><line nr="71" mi="0" ci="6" mb="0" cb="0"/><line nr="93" mi="0" ci="4" mb="0" cb="0"/><line nr="94" mi="0" ci="11" mb="0" cb="2"/><line nr="95" mi="0" ci="6" mb="0" cb="2"/><line nr="96" mi="0" ci="6" mb="0" cb="0"/><line nr="98" mi="0" ci="1" mb="0" cb="0"/><line nr="99" mi="0" ci="11" mb="0" cb="2"/><line nr="100" mi="0" ci="6" mb="0" cb="0"/><line nr="101" mi="0" ci="1" mb="0" cb="0"/><line nr="102" mi="0" ci="4" mb="0" cb="2"/><line nr ="103" mi="0" ci="5" mb="0" cb="0"/><line nr="105" mi="0" ci="2" mb="0" cb="0"/><line nr="106" mi="0" ci="4" mb="0" cb="0"/><line nr="107" mi="0" ci="2" mb="0" cb="0"/><line nr="108" mi="0" ci="1" mb="0" cb="0"/><line nr="119" mi="0" ci="4" mb="0" cb="0"/><line nr="120" mi="0" ci="11" mb="0" cb="2"/><line nr="121" mi="0" ci="3" mb="0" cb="0"/><line nr="122" mi="0" ci="7" mb="0" cb="0"/><line nr="123" mi="0" ci="4" mb="0" cb="0"/><line nr="124" mi="0" ci="5" mb="0" cb="0"/><line nr="125" mi="0" ci="6" mb="0" cb="0"/><line nr="126" mi="0" ci="12" mb="0" cb="0"/><line nr="127" mi="0" ci="5" mb="0" cb="0"/><line nr="128" mi="0" ci="1" mb="0" cb="0"/><line nr="129" mi="0" ci="1" mb="0" cb="0"/><line nr="140" mi="0" ci="11" mb="0" cb="2"/><line nr="141" mi="0" ci="6" mb="0" cb="2"/><line nr="143" mi="0" ci="6" mb="0" cb="0"/><line nr="144" mi="0" ci="3" mb="0" cb="0"/><line nr="145" mi="0" ci="15" mb="0" cb="0"/><line nr="146" mi="0" ci="10" mb="0" cb="0"/><line nr="147" mi="0" ci="3" mb= "0" cb="0"/><line nr="148" mi="0" ci="3" mb="0" cb="0"/><line nr="149" mi="0" ci="15" mb="0" cb="0"/><line nr="150" mi="0" ci="10" mb="0" cb="0"/><line nr="151" mi="0" ci="3" mb="0" cb="0"/><line nr="152" mi="0" ci="2" mb="0" cb="0"/><line nr="153" mi="0" ci="2" mb="0" cb="0"/><line nr="154" mi="1" ci="0" mb="0" cb="0"/><line nr="155" mi="15" ci="0" mb="0" cb="0"/><line nr="156" mi="0" ci="1" mb="0" cb="0"/><line nr="158" mi="0" ci="1" mb="0" cb="0"/><line nr="159" mi="0" ci="1" mb="0" cb="0"/><line nr="169" mi="0" ci="6" mb="0" cb="0"/><line nr="170" mi="0" ci="4" mb="0" cb="0"/><line nr="171" mi="0" ci="5" mb="0" cb="0"/><line nr="172" mi="0" ci="4" mb="0" cb="0"/><line nr="173" mi="0" ci="3" mb="0" cb="0"/><line nr="184" mi="0" ci="6" mb="0" cb="0"/><line nr="185" mi="0" ci="4" mb="0" cb="0"/><line nr="186" mi="0" ci="5" mb="0" cb="0"/><line nr="187" mi="0" ci="4" mb="0" cb="0"/><line nr="188" mi="0" ci="3" mb="0" cb="0"/><counter type="INSTRUCTION" missed="16" covered="291"/><co unter type="BRANCH" missed="0" covered="14"/><counter type="LINE" missed="2" covered="60"/><counter type="COMPLEXITY" missed="0" covered="14"/><counter type="METHOD" missed="0" covered="7"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><sourcefile name="CommonsDistributionStagingMojo.java"><line nr="53" mi="0" ci="3" mb="0" cb="0"/><line nr="114" mi="0" ci="4" mb="0" cb="0"/><line nr="116" mi="0" ci="4" mb="0" cb="0"/><line nr="117" mi="0" ci="6" mb="0" cb="0"/><line nr="118" mi="0" ci="5" mb="0" cb="0"/><line nr="119" mi="0" ci="4" mb="0" cb="0"/><line nr="120" mi="0" ci="4" mb="0" cb="0"/><line nr="121" mi="0" ci="4" mb="0" cb="0"/><line nr="122" mi="0" ci="4" mb="0" cb="0"/><line nr="123" mi="0" ci="4" mb="1" cb="1"/><line nr="124" mi="5" ci="0" mb="0" cb="0"/><line nr="126" mi="0" ci="4" mb="1" cb="1"/><line nr="127" mi="0" ci="5" mb="0" cb="0"/><line nr="129" mi="0" ci="6" mb="0" cb="0"/><line nr="130" mi="0" ci="12" mb="0" cb="0"/><line nr="131" mi="0" ci="5" mb=" 0" cb="0"/><line nr="132" mi="0" ci="2" mb="0" cb="0"/><line nr="133" mi="0" ci="3" mb="0" cb="0"/><line nr="134" mi="0" ci="7" mb="0" cb="0"/><line nr="135" mi="0" ci="4" mb="1" cb="1"/><line nr="136" mi="12" ci="0" mb="0" cb="0"/><line nr="139" mi="9" ci="0" mb="0" cb="0"/><line nr="141" mi="3" ci="0" mb="2" cb="0"/><line nr="142" mi="19" ci="0" mb="0" cb="0"/><line nr="143" mi="12" ci="0" mb="0" cb="0"/><line nr="146" mi="9" ci="0" mb="0" cb="0"/><line nr="148" mi="3" ci="0" mb="2" cb="0"/><line nr="149" mi="12" ci="0" mb="0" cb="0"/><line nr="150" mi="8" ci="0" mb="0" cb="0"/><line nr="151" mi="5" ci="0" mb="0" cb="0"/><line nr="154" mi="1" ci="0" mb="0" cb="0"/><line nr="155" mi="12" ci="0" mb="0" cb="0"/><line nr="156" mi="13" ci="0" mb="0" cb="0"/><line nr="158" mi="1" ci="0" mb="0" cb="0"/><line nr="159" mi="0" ci="12" mb="0" cb="0"/><line nr="160" mi="0" ci="19" mb="0" cb="0"/><line nr="162" mi="1" ci="0" mb="0" cb="0"/><line nr="163" mi="13" ci="0" mb="0" cb="0"/><line nr= "164" mi="14" ci="0" mb="0" cb="0"/><line nr="165" mi="0" ci="1" mb="0" cb="0"/><line nr="166" mi="0" ci="1" mb="0" cb="0"/><line nr="177" mi="0" ci="4" mb="0" cb="0"/><line nr="178" mi="0" ci="13" mb="0" cb="0"/><line nr="179" mi="0" ci="7" mb="0" cb="0"/><line nr="180" mi="0" ci="4" mb="0" cb="0"/><line nr="181" mi="0" ci="5" mb="0" cb="0"/><line nr="182" mi="0" ci="6" mb="0" cb="0"/><line nr="183" mi="0" ci="5" mb="0" cb="0"/><line nr="184" mi="0" ci="1" mb="0" cb="0"/><line nr="210" mi="0" ci="5" mb="0" cb="0"/><line nr="211" mi="0" ci="3" mb="0" cb="0"/><line nr="212" mi="0" ci="3" mb="0" cb="0"/><line nr="213" mi="0" ci="4" mb="0" cb="0"/><line nr="215" mi="0" ci="10" mb="0" cb="2"/><line nr="216" mi="0" ci="5" mb="1" cb="1"/><line nr="217" mi="15" ci="0" mb="0" cb="0"/><line nr="218" mi="5" ci="0" mb="0" cb="0"/><line nr="219" mi="5" ci="0" mb="0" cb="0"/><line nr="220" mi="0" ci="5" mb="1" cb="1"/><line nr="221" mi="15" ci="0" mb="0" cb="0"/><line nr="222" mi="5" ci="0" mb=" 0" cb="0"/><line nr="223" mi="5" ci="0" mb="0" cb="0"/><line nr="224" mi="0" ci="5" mb="0" cb="2"/><line nr="225" mi="0" ci="5" mb="0" cb="0"/><line nr="228" mi="0" ci="17" mb="0" cb="0"/><line nr="229" mi="0" ci="5" mb="0" cb="0"/><line nr="230" mi="0" ci="4" mb="0" cb="0"/><line nr="232" mi="0" ci="1" mb="0" cb="0"/><line nr="233" mi="0" ci="15" mb="0" cb="0"/><line nr="234" mi="0" ci="2" mb="0" cb="0"/><line nr="244" mi="0" ci="7" mb="0" cb="0"/><line nr="245" mi="0" ci="4" mb="0" cb="0"/><line nr="246" mi="0" ci="3" mb="0" cb="0"/><line nr="256" mi="0" ci="7" mb="0" cb="0"/><line nr="257" mi="0" ci="4" mb="0" cb="0"/><line nr="258" mi="0" ci="3" mb="0" cb="0"/><line nr="269" mi="0" ci="3" mb="0" cb="0"/><line nr="270" mi="0" ci="1" mb="0" cb="0"/><counter type="INSTRUCTION" missed="202" covered="289"/><counter type="BRANCH" missed="9" covered="9"/><counter type="LINE" missed="24" covered="54"/><counter type="COMPLEXITY" missed="7" covered="9"/><counter type="METHOD" missed="0" c overed="7"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><sourcefile name="CommonsSiteCompressionMojo.java"><line nr="46" mi="0" ci="3" mb="0" cb="0"/><line nr="77" mi="0" ci="4" mb="0" cb="2"/><line nr="78" mi="0" ci="4" mb="0" cb="0"/><line nr="79" mi="0" ci="5" mb="0" cb="0"/><line nr="83" mi="0" ci="4" mb="1" cb="1"/><line nr="84" mi="5" ci="0" mb="0" cb="0"/><line nr="87" mi="0" ci="5" mb="0" cb="0"/><line nr="88" mi="0" ci="6" mb="0" cb="0"/><line nr="89" mi="0" ci="8" mb="0" cb="0"/><line nr="90" mi="1" ci="0" mb="0" cb="0"/><line nr="91" mi="13" ci="0" mb="0" cb="0"/><line nr="92" mi="8" ci="0" mb="0" cb="0"/><line nr="93" mi="6" ci="0" mb="0" cb="0"/><line nr="96" mi="0" ci="1" mb="0" cb="0"/><line nr="97" mi="0" ci="1" mb="0" cb="0"/><line nr="107" mi="0" ci="3" mb="0" cb="0"/><line nr="108" mi="0" ci="16" mb="0" cb="2"/><line nr="109" mi="0" ci="4" mb="0" cb="0"/><line nr="110" mi="0" ci="3" mb="1" cb="1"/><line nr="111" mi="4" ci="0" mb="0" cb="0"/><line nr ="114" mi="0" ci="1" mb="0" cb="0"/><line nr="128" mi="0" ci="13" mb="0" cb="0"/><line nr="129" mi="0" ci="5" mb="0" cb="0"/><line nr="130" mi="0" ci="10" mb="0" cb="2"/><line nr="131" mi="0" ci="3" mb="1" cb="1"/><line nr="132" mi="0" ci="5" mb="0" cb="0"/><line nr="134" mi="0" ci="1" mb="0" cb="0"/><line nr="135" mi="0" ci="2" mb="0" cb="0"/><line nr="136" mi="0" ci="2" mb="0" cb="0"/><line nr="137" mi="0" ci="1" mb="0" cb="0"/><line nr="150" mi="0" ci="5" mb="0" cb="0"/><line nr="153" mi="0" ci="10" mb="0" cb="0"/><line nr="154" mi="0" ci="2" mb="0" cb="0"/><line nr="155" mi="0" ci="5" mb="0" cb="0"/><line nr="156" mi="0" ci="3" mb="0" cb="0"/><line nr="157" mi="0" ci="3" mb="0" cb="0"/><line nr="159" mi="0" ci="6" mb="0" cb="2"/><line nr="160" mi="0" ci="6" mb="0" cb="0"/><line nr="162" mi="0" ci="2" mb="0" cb="0"/><line nr="163" mi="0" ci="2" mb="0" cb="0"/><line nr="164" mi="0" ci="1" mb="0" cb="0"/><counter type="INSTRUCTION" missed="37" covered="155"/><counter type="BRANCH" missed="3" covered="11"/><counter type="LINE" missed="6" covered="35"/><counter type="COMPLEXITY" missed="3" covered="9"/><counter type="METHOD" missed="0" covered="5"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><counter type="INSTRUCTION" missed="255" covered="735"/><counter type="BRANCH" missed="12" covered="34"/><counter type="LINE" missed="32" covered="149"/><counter type="COMPLEXITY" missed="10" covered="32"/><counter type="METHOD" missed="0" covered="19"/><counter type="CLASS" missed="0" covered="3"/></package><package name="org/apache/commons/release/plugin"><class name="org/apache/commons/release/plugin/SharedFunctions"><method name="<init>" desc="()V" line="45"><counter type="INSTRUCTION" missed="3" covered="0"/><counter type="LINE" missed="2" covered="0"/><counter type="COMPLEXITY" missed="1" covered="0"/><counter type="METHOD" missed="1" covered="0"/></method><method name="initDirectory" desc="(Lorg/apache/maven/plugin/logging/Log;Ljava/io/File;)V" l ine="59"><counter type="INSTRUCTION" missed="22" covered="10"/><counter type="BRANCH" missed="2" covered="2"/><counter type="LINE" missed="5" covered="4"/><counter type="COMPLEXITY" missed="2" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="copyFile" desc="(Lorg/apache/maven/plugin/logging/Log;Ljava/io/File;Ljava/io/File;)V" line="85"><counter type="INSTRUCTION" missed="19" covered="31"/><counter type="BRANCH" missed="0" covered="2"/><counter type="LINE" missed="3" covered="9"/><counter type="COMPLEXITY" missed="0" covered="2"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="44" covered="41"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="10" covered="13"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="1" covered="2"/><counter type="CLASS" missed="0" covered="1"/></class><sourcefile name="SharedFunctions.java"><line nr="45" mi="2" ci="0" mb=" 0" cb="0"/><line nr="47" mi="1" ci="0" mb="0" cb="0"/><line nr="59" mi="0" ci="3" mb="1" cb="1"/><line nr="61" mi="2" ci="0" mb="0" cb="0"/><line nr="62" mi="1" ci="0" mb="0" cb="0"/><line nr="63" mi="4" ci="0" mb="0" cb="0"/><line nr="64" mi="14" ci="0" mb="0" cb="0"/><line nr="65" mi="1" ci="0" mb="0" cb="0"/><line nr="67" mi="0" ci="3" mb="1" cb="1"/><line nr="68" mi="0" ci="3" mb="0" cb="0"/><line nr="70" mi="0" ci="1" mb="0" cb="0"/><line nr="85" mi="0" ci="5" mb="0" cb="0"/><line nr="86" mi="0" ci="5" mb="0" cb="0"/><line nr="87" mi="0" ci="3" mb="0" cb="0"/><line nr="89" mi="0" ci="6" mb="0" cb="2"/><line nr="90" mi="0" ci="6" mb="0" cb="0"/><line nr="92" mi="0" ci="2" mb="0" cb="0"/><line nr="93" mi="0" ci="2" mb="0" cb="0"/><line nr="94" mi="1" ci="0" mb="0" cb="0"/><line nr="95" mi="4" ci="0" mb="0" cb="0"/><line nr="96" mi="14" ci="0" mb="0" cb="0"/><line nr="97" mi="0" ci="1" mb="0" cb="0"/><line nr="98" mi="0" ci="1" mb="0" cb="0"/><counter type="INSTRUCTION" missed="44 " covered="41"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="10" covered="13"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="1" covered="2"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><counter type="INSTRUCTION" missed="44" covered="41"/><counter type="BRANCH" missed="2" covered="4"/><counter type="LINE" missed="10" covered="13"/><counter type="COMPLEXITY" missed="3" covered="3"/><counter type="METHOD" missed="1" covered="2"/><counter type="CLASS" missed="0" covered="1"/></package><counter type="INSTRUCTION" missed="299" covered="776"/><counter type="BRANCH" missed="14" covered="38"/><counter type="LINE" missed="42" covered="162"/><counter type="COMPLEXITY" missed="13" covered="35"/><counter type="METHOD" missed="1" covered="21"/><counter type="CLASS" missed="0" covered="4"/></report> \ No newline at end of file
Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionDetachmentMojo.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionDetachmentMojo.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionDetachmentMojo.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsDistributionDetachmentMojo</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.html" class="el_package">org.apache.commons.release.plugin.mojos</a> > <span class="el_class">CommonsDistributionDetachmentMojo</span></div><h1>CommonsDistri butionDetachmentMojo</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">16 of 307</td><td class="ctr2">94%</td><td class="ba r">0 of 14</td><td class="ctr2">100%</td><td class="ctr1">0</td><td class="ctr2">14</td><td class="ctr1">2</td><td class="ctr2">62</td><td class="ctr1">0</td><td class="ctr2">7</td></tr></tfoot><tbody><tr><td id="a5"><a href="CommonsDistributionDetachmentMojo.java.html#L140" class="el_method">sha1AndMd5SignArtifacts()</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="17" height="10" title="16" alt="16"/><img src="../jacoco-resources/greenbar.gif" width="102" height="10" title="92" alt="92"/></td><td class="ctr2" id="c6">85%</td><td class="bar" id="d1"><img src="../jacoco-resources/greenbar.gif" width="60" height="10" title="4" alt="4"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g1">3</td><td class="ctr1" id="h0">2</td><td class="ctr2" id="i0">18</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a2"><a href="CommonsDistributionDetachmentMojo.java.html#L93" class="el_method" >execute()</a></td><td class="bar" id="b1"><img >src="../jacoco-resources/greenbar.gif" width="71" height="10" title="64" >alt="64"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img >src="../jacoco-resources/greenbar.gif" width="120" height="10" title="8" >alt="8"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" >id="f1">0</td><td class="ctr2" id="g0">5</td><td class="ctr1" >id="h1">0</td><td class="ctr2" id="i1">14</td><td class="ctr1" >id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a >href="CommonsDistributionDetachmentMojo.java.html#L119" >class="el_method">copyRemovedArtifactsToWorkingDirectory()</a></td><td >class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="65" >height="10" title="59" alt="59"/></td><td class="ctr2" id="c1">100%</td><td >class="bar" id="d2"><img src="../jacoco-resources/greenbar.gif" width="30" >height="10" title="2" alt="2"/></td><td class="ctr2" id="e2">100%</td><td >class="ctr1" id="f2">0</td><td class="c tr2" id="g2">2</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">11</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a6"><a href="CommonsDistributionDetachmentMojo.java.html#L59" class="el_method">static {...}</a></td><td class="bar" id="b3"><img src="../jacoco-resources/greenbar.gif" width="26" height="10" title="24" alt="24"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">7</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a3"><a href="CommonsDistributionDetachmentMojo.java.html#L169" class="el_method">getMd5FilePath(File, File)</a></td><td class="bar" id="b4"><img src="../jacoco-resources/greenbar.gif" width="24" height="10" title="22" alt="22"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</t d><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">5</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a4"><a href="CommonsDistributionDetachmentMojo.java.html#L184" class="el_method">getSha1FilePath(File, File)</a></td><td class="bar" id="b5"><img src="../jacoco-resources/greenbar.gif" width="24" height="10" title="22" alt="22"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i5">5</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a0"><a href="CommonsDistributionDetachmentMojo.java.html#L48" class="el_method">CommonsDistributionDetachmentMojo()</a></td><td class="bar" id="b6"><img src="../jacoco-resources/greenbar.gif" width="8" height="10" title="8" alt="8"/></td><td class="ctr2" id="c5"> 100%</td><td class="bar" id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i6">2</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html> \ No newline at end of file Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionDetachmentMojo.java.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionDetachmentMojo.java.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionDetachmentMojo.java.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1,191 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsDistributionDetachmentMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.source.html" class="el_package">org.apache.commons.release.p lugin.mojos</a> > <span class="el_source">CommonsDistributionDetachmentMojo.java</span></div><h1>CommonsDistributionDetachmentMojo.java</h1><pre class="source lang-java linenums">/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.release.plugin.mojos; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.release.plugin.SharedFunctions; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.apache.maven.artifact.Artifact; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin, + * which for the Apache Commons Project do not get uploaded to Nexus, and putting those artifacts + * in the dev distribution location for apache projects. + * + * @author chtompki + * @since 1.0 + */ +@Mojo(name = "detach-distributions", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true) +<span class="fc" id="L48">public class CommonsDistributionDetachmentMojo extends AbstractMojo {</span> + + /** + * A list of "artifact types" in the maven vernacular, to + * be detached from the deployment. For the time being we want + * all artifacts generated by the maven-assembly-plugin to be detatched + * from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip, + * *-bin.tar.gz, and the corresponding .asc pgp signatures. + */ + private static final Set<String> ARTIFACT_TYPES_TO_DETATCH; + static { +<span class="fc" id="L59"> Set<String> hashSet = new HashSet<>();</span> +<span class="fc" id="L60"> hashSet.add("zip");</span> +<span class="fc" id="L61"> hashSet.add("tar.gz");</span> +<span class="fc" id="L62"> hashSet.add("zip.asc");</span> +<span class="fc" id="L63"> hashSet.add("tar.gz.asc");</span> +<span class="fc" id="L64"> ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);</span> +<span class="fc" id="L65"> }</span> + + /** + * This list is supposed to hold the maven references to the aformentioned artifacts so that we + * can upload them to svn after they've been detatched from the maven deployment. + */ +<span class="fc" id="L71"> private List<Artifact> detatchedArtifacts = new ArrayList<>();</span> + + /** + * The maven project context injection so that we can get a hold of the variables at hand. + */ + @Parameter(defaultValue = "${project}", required = true) + private MavenProject project; + + /** + * The working directory in <code>target</code> that we use as a sandbox for the plugin. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory") + private File workingDirectory; + + /** + * The subversion staging url to which we upload all of our staged artifacts. + */ + @Parameter(required = true) + private String distSvnStagingUrl; + + @Override + public void execute() throws MojoExecutionException { +<span class="fc" id="L93"> getLog().info("Detatching Assemblies");</span> +<span class="fc bfc" id="L94" title="All 2 branches covered."> for (Object attachedArtifact : project.getAttachedArtifacts()) {</span> +<span class="fc bfc" id="L95" title="All 2 branches covered."> if (ARTIFACT_TYPES_TO_DETATCH.contains(((Artifact) attachedArtifact).getType())) {</span> +<span class="fc" id="L96"> detatchedArtifacts.add((Artifact) attachedArtifact);</span> + } +<span class="fc" id="L98"> }</span> +<span class="fc bfc" id="L99" title="All 2 branches covered."> for (Artifact artifactToRemove : detatchedArtifacts) {</span> +<span class="fc" id="L100"> project.getAttachedArtifacts().remove(artifactToRemove);</span> +<span class="fc" id="L101"> }</span> +<span class="fc bfc" id="L102" title="All 2 branches covered."> if (!workingDirectory.exists()) {</span> +<span class="fc" id="L103"> SharedFunctions.initDirectory(getLog(), workingDirectory);</span> + } +<span class="fc" id="L105"> copyRemovedArtifactsToWorkingDirectory();</span> +<span class="fc" id="L106"> getLog().info("");</span> +<span class="fc" id="L107"> sha1AndMd5SignArtifacts();</span> +<span class="fc" id="L108"> }</span> + + /** + * A helper method to copy the newly detached artifacts to <code>target/commons-release-plugin</code> + * so that the {@link CommonsDistributionStagingMojo} can find the artifacts later. + * + * @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it + * properly wrapped so that maven can handle it. + */ + private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException { + StringBuffer copiedArtifactAbsolutePath; +<span class="fc" id="L119"> getLog().info("Copying detatched artifacts to working directory.");</span> +<span class="fc bfc" id="L120" title="All 2 branches covered."> for (Artifact artifact: detatchedArtifacts) {</span> +<span class="fc" id="L121"> File artifactFile = artifact.getFile();</span> +<span class="fc" id="L122"> copiedArtifactAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());</span> +<span class="fc" id="L123"> copiedArtifactAbsolutePath.append("/");</span> +<span class="fc" id="L124"> copiedArtifactAbsolutePath.append(artifactFile.getName());</span> +<span class="fc" id="L125"> File copiedArtifact = new File(copiedArtifactAbsolutePath.toString());</span> +<span class="fc" id="L126"> getLog().info("Copying: " + artifactFile.getName());</span> +<span class="fc" id="L127"> SharedFunctions.copyFile(getLog(), artifactFile, copiedArtifact);</span> +<span class="fc" id="L128"> }</span> +<span class="fc" id="L129"> }</span> + + /** + * A helper method that creates md5 and sha1 signature files for our detached artifacts in the + * <code>target/commons-release-plugin</code> directory for the purpose of being uploade by + * the {@link CommonsDistributionStagingMojo}. + * + * @throws MojoExecutionException if some form of an {@link IOException} occurs, we want it + * properly wrapped so that maven can handle it. + */ + private void sha1AndMd5SignArtifacts() throws MojoExecutionException { +<span class="fc bfc" id="L140" title="All 2 branches covered."> for (Artifact artifact : detatchedArtifacts) {</span> +<span class="fc bfc" id="L141" title="All 2 branches covered."> if (!artifact.getFile().getName().contains("asc")) {</span> + try { +<span class="fc" id="L143"> FileInputStream artifactFileInputStream = new FileInputStream(artifact.getFile());</span> +<span class="fc" id="L144"> String md5 = DigestUtils.md5Hex(artifactFileInputStream);</span> +<span class="fc" id="L145"> getLog().info(artifact.getFile().getName() + " md5: " + md5);</span> +<span class="fc" id="L146"> PrintWriter md5Writer = new PrintWriter(getMd5FilePath(workingDirectory, artifact.getFile()));</span> +<span class="fc" id="L147"> md5Writer.println(md5);</span> +<span class="fc" id="L148"> String sha1 = DigestUtils.sha1Hex(artifactFileInputStream);</span> +<span class="fc" id="L149"> getLog().info(artifact.getFile().getName() + " sha1: " + sha1);</span> +<span class="fc" id="L150"> PrintWriter sha1Writer = new PrintWriter(getSha1FilePath(workingDirectory, artifact.getFile()));</span> +<span class="fc" id="L151"> sha1Writer.println(sha1);</span> +<span class="fc" id="L152"> md5Writer.close();</span> +<span class="fc" id="L153"> sha1Writer.close();</span> +<span class="nc" id="L154"> } catch (IOException e) {</span> +<span class="nc" id="L155"> throw new MojoExecutionException("Could not sign file: " + artifact.getFile().getName(), e);</span> +<span class="fc" id="L156"> }</span> + } +<span class="fc" id="L158"> }</span> +<span class="fc" id="L159"> }</span> + + /** + * A helper method to create a file path for the <code>md5</code> signature file from a given file. + * + * @param workingDirectory is the {@link File} for the directory in which to make the <code>.md5</code> file. + * @param file the {@link File} whose name we should use to create the <code>.md5</code> file. + * @return a {@link String} that is the absolute path to the <code>.md5</code> file. + */ + private String getMd5FilePath(File workingDirectory, File file) { +<span class="fc" id="L169"> StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());</span> +<span class="fc" id="L170"> buffer.append("/");</span> +<span class="fc" id="L171"> buffer.append(file.getName());</span> +<span class="fc" id="L172"> buffer.append(".md5");</span> +<span class="fc" id="L173"> return buffer.toString();</span> + } + + /** + * A helper method to create a file path for the <code>sha1</code> signature file from a given file. + * + * @param workingDirectory is the {@link File} for the directory in which to make the <code>.sha1</code> file. + * @param file the {@link File} whose name we should use to create the <code>.sha1</code> file. + * @return a {@link String} that is the absolute path to the <code>.sha1</code> file. + */ + private String getSha1FilePath(File workingDirectory, File file) { +<span class="fc" id="L184"> StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());</span> +<span class="fc" id="L185"> buffer.append("/");</span> +<span class="fc" id="L186"> buffer.append(file.getName());</span> +<span class="fc" id="L187"> buffer.append(".sha1");</span> +<span class="fc" id="L188"> return buffer.toString();</span> + } +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html> \ No newline at end of file Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsDistributionStagingMojo</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.html" class="el_package">org.apache.commons.release.plugin.mojos</a> > <span class="el_class">CommonsDistributionStagingMojo</span></div><h1>CommonsDistribution StagingMojo</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">202 of 491</td><td class="ctr2">58%</td><td class="bar">9 of 18</td><td class="ctr2">50%</td><td class="ctr1">7</td><td class="ctr2">16</td><td class="ctr1">24</td><td class="ctr2">78</td><td class="ctr1">0</td><td class="ctr2">7</td></tr></tfoot><tbody><tr><td id="a5"><a href="CommonsDistributionStagingMojo.java.html#L114" class="el_method">execute()</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="67" height="10" title="152" alt="152"/><img src="../jacoco-resources/greenbar.gif" width="52" height="10" title="120" alt="120"/></td><td class="ctr2" id="c6">44%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="84" height="10" title="7" alt="7"/><img src="../jacoco-resources/greenbar.gif" width="36" height="10" title="3" alt="3"/></td><td class="ctr2" id="e1">30%</td><td class="ctr1" id="f0">5</td><td class="ctr2" id="g0">6</td><td class="ctr1" id="h0">18</td><td class="ctr2" id="i0">40</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a3"><a href="Common sDistributionStagingMojo.java.html#L210" class="el_method">copyDistributionsIntoScmDirectoryStructure()</a></td><td class="bar" id="b1"><img src="../jacoco-resources/redbar.gif" width="22" height="10" title="50" alt="50"/><img src="../jacoco-resources/greenbar.gif" width="39" height="10" title="89" alt="89"/></td><td class="ctr2" id="c5">64%</td><td class="bar" id="d1"><img src="../jacoco-resources/redbar.gif" width="24" height="10" title="2" alt="2"/><img src="../jacoco-resources/greenbar.gif" width="72" height="10" title="6" alt="6"/></td><td class="ctr2" id="e0">75%</td><td class="ctr1" id="f1">2</td><td class="ctr2" id="g1">5</td><td class="ctr1" id="h1">6</td><td class="ctr2" id="i1">21</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a4"><a href="CommonsDistributionStagingMojo.java.html#L177" class="el_method">copyReleaseNotesToWorkingDirectory()</a></td><td class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="19" height="10" title="45" alt="45"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">8</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a0"><a href="CommonsDistributionStagingMojo.java.html#L244" class="el_method">buildDistBinariesRoot()</a></td><td class="bar" id="b3"><img src="../jacoco-resources/greenbar.gif" width="6" height="10" title="14" alt="14"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">3</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a1"><a href="CommonsDistributionStagingMojo.java.html#L256" class="el_method">buildDistSourceRoot()</a></td><td class="bar" id="b4"><img src="../jacoco-re sources/greenbar.gif" width="6" height="10" title="14" alt="14"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">3</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a6"><a href="CommonsDistributionStagingMojo.java.html#L269" class="el_method">setBasedir(File)</a></td><td class="bar" id="b5"><img src="../jacoco-resources/greenbar.gif" width="1" height="10" title="4" alt="4"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i5">2</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a2"><a href="CommonsDistributionStagingMojo.java.html#L53" class="el_method">CommonsDistributionStagingMojo()</a></td><t d class="bar" id="b6"><img src="../jacoco-resources/greenbar.gif" width="1" height="10" title="3" alt="3"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i6">1</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html> \ No newline at end of file Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.java.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.java.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.java.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1,272 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsDistributionStagingMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.source.html" class="el_package">org.apache.commons.release.plug in.mojos</a> > <span class="el_source">CommonsDistributionStagingMojo.java</span></div><h1>CommonsDistributionStagingMojo.java</h1><pre class="source lang-java linenums">/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.release.plugin.mojos; + +import org.apache.commons.release.plugin.SharedFunctions; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.apache.maven.scm.ScmException; +import org.apache.maven.scm.ScmFileSet; +import org.apache.maven.scm.command.add.AddScmResult; +import org.apache.maven.scm.command.checkin.CheckInScmResult; +import org.apache.maven.scm.manager.BasicScmManager; +import org.apache.maven.scm.manager.ScmManager; +import org.apache.maven.scm.provider.ScmProvider; +import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; +import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider; +import org.apache.maven.scm.repository.ScmRepository; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This class checks out the dev distribution location, copies the distributions into that directory + * structure under the <code>target/commons-release-plugin/scm</code> directory. Then commits the + * distributions back up to SVN. Also, we include the built and zipped site as well as the RELEASE-NOTES.txt. + * + * @author chtompki + * @since 1.0 + */ +@Mojo(name = "stage-distributions", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true) +<span class="fc" id="L53">public class CommonsDistributionStagingMojo extends AbstractMojo {</span> + + /** + * The {@link MavenProject} object is essentially the context of the maven build at + * a given time. + */ + @Parameter(defaultValue = "${project}", required = true) + private MavenProject project; + + /** + * The {@link File} that contains a file to the root directory of the working project. Typically + * this directory is where the <code>pom.xml</code> resides. + */ + @Parameter(defaultValue = "${basedir}") + private File basedir; + + /** + * The main working directory for the plugin, namely <code>target/commons-release-plugin</code>, but + * that assumes that we're using the default maven <code>${project.build.directory}</code>. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory") + private File workingDirectory; + + /** + * The location to which to checkout the dist subversion repository under our working directory, which + * was given above. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm", alias = "outputDirectory") + private File distCheckoutDirectory; + + /** + * A boolean that determines whether or not we actually commit the files up to the subversion repository. + * If this is set to <code>true</code>, we do all but make the commits. We do checkout the repository in question + * though. + */ + @Parameter(defaultValue = "false") + private Boolean dryRun; + + /** + * The url of the subversion repository to which we wish the artifacts to be staged. Typicallly + * this would need to be of the form: + * <code>scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo</code>. Note. that the prefix to the + * substring <code>https</code> is a requirement. + */ + @Parameter(required = true) + private String distSvnStagingUrl; + + /** + * The username for the distribution subversion repository. This is typically your apache id. + */ + @Parameter(property = "user.name") + private String username; + + /** + * The password associated with {@link CommonsDistributionStagingMojo#username}. + */ + @Parameter(property = "user.password") + private String password; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { +<span class="fc" id="L114"> getLog().info("Preparing to stage distributions");</span> + try { +<span class="fc" id="L116"> ScmManager scmManager = new BasicScmManager();</span> +<span class="fc" id="L117"> scmManager.setScmProvider("svn", new SvnExeScmProvider());</span> +<span class="fc" id="L118"> ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);</span> +<span class="fc" id="L119"> ScmProvider provider = scmManager.getProviderByRepository(repository);</span> +<span class="fc" id="L120"> SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository.getProviderRepository();</span> +<span class="fc" id="L121"> providerRepository.setUser(username);</span> +<span class="fc" id="L122"> providerRepository.setPassword(password);</span> +<span class="pc bpc" id="L123" title="1 of 2 branches missed."> if (!workingDirectory.exists()) {</span> +<span class="nc" id="L124"> SharedFunctions.initDirectory(getLog(), workingDirectory);</span> + } +<span class="pc bpc" id="L126" title="1 of 2 branches missed."> if (!distCheckoutDirectory.exists()) {</span> +<span class="fc" id="L127"> SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);</span> + } +<span class="fc" id="L129"> ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);</span> +<span class="fc" id="L130"> getLog().info("Checking out dist from: " + distSvnStagingUrl);</span> +<span class="fc" id="L131"> provider.checkOut(repository, scmFileSet);</span> +<span class="fc" id="L132"> copyReleaseNotesToWorkingDirectory();</span> +<span class="fc" id="L133"> List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure();</span> +<span class="fc" id="L134"> ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);</span> +<span class="pc bpc" id="L135" title="1 of 2 branches missed."> if (!dryRun) {</span> +<span class="nc" id="L136"> AddScmResult addResult = provider.add(</span> + repository, + scmFileSetToCommit, +<span class="nc" id="L139"> "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()</span> + ); +<span class="nc bnc" id="L141" title="All 2 branches missed."> if (addResult.isSuccess()) {</span> +<span class="nc" id="L142"> getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());</span> +<span class="nc" id="L143"> CheckInScmResult checkInResult = provider.checkIn(</span> + repository, + scmFileSetToCommit, +<span class="nc" id="L146"> "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()</span> + ); +<span class="nc bnc" id="L148" title="All 2 branches missed."> if (!checkInResult.isSuccess()) {</span> +<span class="nc" id="L149"> getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());</span> +<span class="nc" id="L150"> throw new MojoExecutionException(</span> +<span class="nc" id="L151"> "Committing dist files failed: " + checkInResult.getCommandOutput()</span> + ); + } +<span class="nc" id="L154"> } else {</span> +<span class="nc" id="L155"> getLog().error("Adding dist files failed: " + addResult.getCommandOutput());</span> +<span class="nc" id="L156"> throw new MojoExecutionException("Adding dist files failed: " + addResult.getCommandOutput());</span> + } +<span class="nc" id="L158"> } else {</span> +<span class="fc" id="L159"> getLog().info("Would have committed to: " + distSvnStagingUrl);</span> +<span class="fc" id="L160"> getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());</span> + } +<span class="nc" id="L162"> } catch (ScmException e) {</span> +<span class="nc" id="L163"> getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);</span> +<span class="nc" id="L164"> throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);</span> +<span class="fc" id="L165"> }</span> +<span class="fc" id="L166"> }</span> + + /** + * A utility method that takes the <code>RELEASE-NOTES.txt</code> file from the base directory of the + * project and copies it into {@link CommonsDistributionStagingMojo#workingDirectory}. + * + * @throws MojoExecutionException if an {@link IOException} occurrs as a wrapper so that maven + * can properly handle the exception. + */ + private void copyReleaseNotesToWorkingDirectory() throws MojoExecutionException { + StringBuffer copiedReleaseNotesAbsolutePath; +<span class="fc" id="L177"> getLog().info("Copying RELEASE-NOTES.txt to working directory.");</span> +<span class="fc" id="L178"> File releaseNotes = new File(basedir + "/RELEASE-NOTES.txt");</span> +<span class="fc" id="L179"> copiedReleaseNotesAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());</span> +<span class="fc" id="L180"> copiedReleaseNotesAbsolutePath.append("/scm/");</span> +<span class="fc" id="L181"> copiedReleaseNotesAbsolutePath.append(releaseNotes.getName());</span> +<span class="fc" id="L182"> File copiedReleaseNotes = new File(copiedReleaseNotesAbsolutePath.toString());</span> +<span class="fc" id="L183"> SharedFunctions.copyFile(getLog(), releaseNotes, copiedReleaseNotes);</span> +<span class="fc" id="L184"> }</span> + + /** + * Copies the list of files at the root of the {@link CommonsDistributionStagingMojo#workingDirectory} into + * the directory structure of the distribution staging repository. Specifically: + * <ul> + * <li>root:</li> + * <li><ul> + * <li>site.zip</li> + * <li>RELEASE-NOTES.txt</li> + * <li>source:</li> + * <li><ul> + * <li>-src artifacts....</li> + * </ul></li> + * <li>binaries:</li> + * <li><ul> + * <li>-bin artifacts....</li> + * </ul></li> + * </ul></li> + * </ul> + * + * @return a {@link List} of {@link File}'s in the directory for the purpose of adding them to the maven + * {@link ScmFileSet}. + * @throws MojoExecutionException if an {@link IOException} occurrs so that Maven can handle it properly. + */ + private List<File> copyDistributionsIntoScmDirectoryStructure() throws MojoExecutionException { +<span class="fc" id="L210"> List<File> workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());</span> +<span class="fc" id="L211"> String scmBinariesRoot = buildDistBinariesRoot();</span> +<span class="fc" id="L212"> String scmSourceRoot = buildDistSourceRoot();</span> +<span class="fc" id="L213"> List<File> filesForMavenScmFileSet = new ArrayList<>();</span> + File copy; +<span class="fc bfc" id="L215" title="All 2 branches covered."> for (File file : workingDirectoryFiles) {</span> +<span class="pc bpc" id="L216" title="1 of 2 branches missed."> if (file.getName().contains("src")) {</span> +<span class="nc" id="L217"> copy = new File(scmSourceRoot + "/" + file.getName());</span> +<span class="nc" id="L218"> SharedFunctions.copyFile(getLog(), file, copy);</span> +<span class="nc" id="L219"> filesForMavenScmFileSet.add(copy);</span> +<span class="pc bpc" id="L220" title="1 of 2 branches missed."> } else if (file.getName().contains("bin")) {</span> +<span class="nc" id="L221"> copy = new File(scmBinariesRoot + "/" + file.getName());</span> +<span class="nc" id="L222"> SharedFunctions.copyFile(getLog(), file, copy);</span> +<span class="nc" id="L223"> filesForMavenScmFileSet.add(copy);</span> +<span class="fc bfc" id="L224" title="All 2 branches covered."> } else if (file.getName().contains("scm")) {</span> +<span class="fc" id="L225"> getLog().debug("Not copying scm directory over to the scm directory because it is the scm directory.");</span> + //do nothing because we are copying into scm + } else { +<span class="fc" id="L228"> copy = new File(distCheckoutDirectory.getAbsolutePath() + "/" + file.getName());</span> +<span class="fc" id="L229"> SharedFunctions.copyFile(getLog(), file, copy);</span> +<span class="fc" id="L230"> filesForMavenScmFileSet.add(copy);</span> + } +<span class="fc" id="L232"> }</span> +<span class="fc" id="L233"> filesForMavenScmFileSet.add(new File(distCheckoutDirectory + "/RELEASE-NOTES.txt"));</span> +<span class="fc" id="L234"> return filesForMavenScmFileSet;</span> + } + + /** + * Build the path for the distribution binaries directory. + * + * @return the local absolute path into the checkedout subversion repository that is where + * the binaries distributions are to be copied. + */ + private String buildDistBinariesRoot() { +<span class="fc" id="L244"> StringBuffer buffer = new StringBuffer(distCheckoutDirectory.getAbsolutePath());</span> +<span class="fc" id="L245"> buffer.append("/binaries");</span> +<span class="fc" id="L246"> return buffer.toString();</span> + } + + /** + * Build the path for the distribution source directory. + * + * @return the local absolute path into the checkedout subversion repository that is where + * the source distributions are to be copied. + */ + private String buildDistSourceRoot() { +<span class="fc" id="L256"> StringBuffer buffer = new StringBuffer(distCheckoutDirectory.getAbsolutePath());</span> +<span class="fc" id="L257"> buffer.append("/source");</span> +<span class="fc" id="L258"> return buffer.toString();</span> + } + + /** + * This method is the setter for the {@link CommonsDistributionStagingMojo#basedir} field, specifically + * for the usage in the unit tests. + * + * @param basedir is the {@link File} to be used as the project's root directory when this mojo + * is invoked. + */ + protected void setBasedir(File basedir) { +<span class="fc" id="L269"> this.basedir = basedir;</span> +<span class="fc" id="L270"> }</span> +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html> \ No newline at end of file Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsSiteCompressionMojo</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.html" class="el_package">org.apache.commons.release.plugin.mojos</a> > <span class="el_class">CommonsSiteCompressionMojo</span></div><h1>CommonsSiteCompressionMojo< /h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">37 of 192</td><td class="ctr2">80%</td><td class="bar">3 of 14</td><td cl ass="ctr2">78%</td><td class="ctr1">3</td><td class="ctr2">12</td><td class="ctr1">6</td><td class="ctr2">41</td><td class="ctr1">0</td><td class="ctr2">5</td></tr></tfoot><tbody><tr><td id="a2"><a href="CommonsSiteCompressionMojo.java.html#L77" class="el_method">execute()</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="55" height="10" title="33" alt="33"/><img src="../jacoco-resources/greenbar.gif" width="64" height="10" title="38" alt="38"/></td><td class="ctr2" id="c4">53%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="30" height="10" title="1" alt="1"/><img src="../jacoco-resources/greenbar.gif" width="90" height="10" title="3" alt="3"/></td><td class="ctr2" id="e1">75%</td><td class="ctr1" id="f0">1</td><td class="ctr2" id="g0">3</td><td class="ctr1" id="h0">5</td><td class="ctr2" id="i0">14</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a3"><a href="CommonsSiteCompressionMojo.jav a.html#L107" class="el_method">getAllSiteFiles(File, List)</a></td><td class="bar" id="b1"><img src="../jacoco-resources/redbar.gif" width="6" height="10" title="4" alt="4"/><img src="../jacoco-resources/greenbar.gif" width="45" height="10" title="27" alt="27"/></td><td class="ctr2" id="c3">87%</td><td class="bar" id="d1"><img src="../jacoco-resources/redbar.gif" width="30" height="10" title="1" alt="1"/><img src="../jacoco-resources/greenbar.gif" width="90" height="10" title="3" alt="3"/></td><td class="ctr2" id="e2">75%</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g1">3</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i3">6</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a0"><a href="CommonsSiteCompressionMojo.java.html#L150" class="el_method">addToZip(File, File, ZipOutputStream)</a></td><td class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="76" height="10" title="45" alt="45"/></td><td class="ctr2" id="c0"> 100%</td><td class="bar" id="d3"><img src="../jacoco-resources/greenbar.gif" width="60" height="10" title="2" alt="2"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">2</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i1">11</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a4"><a href="CommonsSiteCompressionMojo.java.html#L128" class="el_method">writeZipFile(File, File, List)</a></td><td class="bar" id="b3"><img src="../jacoco-resources/greenbar.gif" width="70" height="10" title="42" alt="42"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d2"><img src="../jacoco-resources/redbar.gif" width="30" height="10" title="1" alt="1"/><img src="../jacoco-resources/greenbar.gif" width="90" height="10" title="3" alt="3"/></td><td class="ctr2" id="e3">75%</td><td class="ctr1" id="f2">1</td><td class="ctr2" id="g2">3</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i2">9</td><td class="ctr1 " id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a1"><a href="CommonsSiteCompressionMojo.java.html#L46" class="el_method">CommonsSiteCompressionMojo()</a></td><td class="bar" id="b4"><img src="../jacoco-resources/greenbar.gif" width="5" height="10" title="3" alt="3"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">1</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html> \ No newline at end of file Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.java.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.java.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.java.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsSiteCompressionMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.source.html" class="el_package">org.apache.commons.release.plugin.m ojos</a> > <span class="el_source">CommonsSiteCompressionMojo.java</span></div><h1>CommonsSiteCompressionMojo.java</h1><pre class="source lang-java linenums">/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.release.plugin.mojos; + +import org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator; +import org.apache.commons.compress.archivers.zip.ScatterZipOutputStream; +import org.apache.commons.release.plugin.SharedFunctions; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * Takes the built <code>./target/site</code> directory and compresses it to + * <code>./target/commons-release-plugin/site.zip</code>. + * + * @author chtompki + * @since 1.0 + */ +@Mojo(name = "compress-site", defaultPhase = LifecyclePhase.POST_SITE, threadSafe = true) +<span class="fc" id="L46">public class CommonsSiteCompressionMojo extends AbstractMojo {</span> + + /** + * The working directory for the plugin which, assuming the maven uses the default + * <code>${project.build.directory}</code>, this becomes <code>target/commons-release-plugin</code>. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory") + private File workingDirectory; + + /** + */ + @Parameter(defaultValue = "${project.build.directory}/site", alias = "siteOutputDirectory") + private File siteDirectory; + + /** + * A variable for the process of creating the site.zip file. + */ + private ScatterZipOutputStream dirs; + + /** + * A second variable for the process of creating the site.zip file. + */ + private ParallelScatterZipCreator scatterZipCreator; + + /** + * The list of files to compress into the site.zip file. + */ + private List<File> filesToCompress; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { +<span class="fc bfc" id="L77" title="All 2 branches covered."> if (!siteDirectory.exists()) {</span> +<span class="fc" id="L78"> getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");</span> +<span class="fc" id="L79"> throw new MojoFailureException(</span> + "\"mvn site\" was not run before this goal, or a siteDirectory did not exist." + ); + } +<span class="pc bpc" id="L83" title="1 of 2 branches missed."> if (!workingDirectory.exists()) {</span> +<span class="nc" id="L84"> SharedFunctions.initDirectory(getLog(), workingDirectory);</span> + } + try { +<span class="fc" id="L87"> filesToCompress = new ArrayList<>();</span> +<span class="fc" id="L88"> getAllSiteFiles(siteDirectory, filesToCompress);</span> +<span class="fc" id="L89"> writeZipFile(workingDirectory, siteDirectory, filesToCompress);</span> +<span class="nc" id="L90"> } catch (IOException e) {</span> +<span class="nc" id="L91"> getLog().error("Failed to create ./target/commons-release-plugin/site.zip: " + e.getMessage(), e);</span> +<span class="nc" id="L92"> throw new MojoExecutionException(</span> +<span class="nc" id="L93"> "Failed to create ./target/commons-release-plugin/site.zip: " + e.getMessage(),</span> + e + ); +<span class="fc" id="L96"> }</span> +<span class="fc" id="L97"> }</span> + + /** + * By default this method iterates across the <code>target/site</code> directory and adds all of the files + * to the {@link CommonsSiteCompressionMojo#filesToCompress} {@link List}. + * + * @param siteDirectory the {@link File} that represents the <code>target/site</code> directory. + * @param filesToCompress the {@link List} to which to add all the files. + */ + private void getAllSiteFiles(File siteDirectory, List<File> filesToCompress) { +<span class="fc" id="L107"> File[] files = siteDirectory.listFiles();</span> +<span class="fc bfc" id="L108" title="All 2 branches covered."> for (File file : files) {</span> +<span class="fc" id="L109"> filesToCompress.add(file);</span> +<span class="pc bpc" id="L110" title="1 of 2 branches missed."> if (file.isDirectory()) {</span> +<span class="nc" id="L111"> getAllSiteFiles(file, filesToCompress);</span> + } + } +<span class="fc" id="L114"> }</span> + + /** + * A helper method for writing all of the files in our <code>fileList</code> to a <code>site.zip</code> file + * in the <code>workingDirectory</code>. + * + * @param workingDirectory is a {@link File} representing the place to put the site.zip file. + * @param directoryToZip is a {@link File} representing the directory of the site (normally + * <code>target/site</code>). + * @param fileList the list of files to be zipped up, generally generated by + * {@link CommonsSiteCompressionMojo#getAllSiteFiles(File, List)}. + * @throws IOException when the copying of the files goes incorrectly. + */ + private void writeZipFile(File workingDirectory, File directoryToZip, List<File> fileList) throws IOException { +<span class="fc" id="L128"> FileOutputStream fos = new FileOutputStream(workingDirectory.getAbsolutePath() + "/site.zip");</span> +<span class="fc" id="L129"> ZipOutputStream zos = new ZipOutputStream(fos);</span> +<span class="fc bfc" id="L130" title="All 2 branches covered."> for (File file : fileList) {</span> +<span class="pc bpc" id="L131" title="1 of 2 branches missed."> if (!file.isDirectory()) { // we only zip files, not directories</span> +<span class="fc" id="L132"> addToZip(directoryToZip, file, zos);</span> + } +<span class="fc" id="L134"> }</span> +<span class="fc" id="L135"> zos.close();</span> +<span class="fc" id="L136"> fos.close();</span> +<span class="fc" id="L137"> }</span> + + /** + * Given the <code>directoryToZip</code> we add the <code>file</code> to the zip archive represented by + * <code>zos</code>. + * + * @param directoryToZip a {@link File} representing the directory from which the file exists that we are + * compressing. Generally this is <code>target/site</code>. + * @param file a {@link File} to add to the {@link ZipOutputStream} <code>zos</code>. + * @param zos the {@link ZipOutputStream} to which to add our <code>file</code>. + * @throws IOException if adding the <code>file</code> doesn't work out properly. + */ + private void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws IOException { +<span class="fc" id="L150"> FileInputStream fis = new FileInputStream(file);</span> + // we want the zipEntry's path to be a relative path that is relative + // to the directory being zipped, so chop off the rest of the path +<span class="fc" id="L153"> String zipFilePath = file.getCanonicalPath().substring(directoryToZip.getCanonicalPath().length() + 1,</span> +<span class="fc" id="L154"> file.getCanonicalPath().length());</span> +<span class="fc" id="L155"> ZipEntry zipEntry = new ZipEntry(zipFilePath);</span> +<span class="fc" id="L156"> zos.putNextEntry(zipEntry);</span> +<span class="fc" id="L157"> byte[] bytes = new byte[SharedFunctions.BUFFER_BYTE_SIZE];</span> + int length; +<span class="fc bfc" id="L159" title="All 2 branches covered."> while ((length = fis.read(bytes)) >= 0) {</span> +<span class="fc" id="L160"> zos.write(bytes, 0, length);</span> + } +<span class="fc" id="L162"> zos.closeEntry();</span> +<span class="fc" id="L163"> fis.close();</span> +<span class="fc" id="L164"> }</span> +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html> \ No newline at end of file Added: websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/index.html ============================================================================== --- websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/index.html (added) +++ websites/production/commons/content/proper/commons-release-plugin/jacoco/org.apache.commons.release.plugin.mojos/index.html Thu Jan 11 01:05:54 2018 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>org.apache.commons.release.plugin.mojos</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.source.html" class="el_source">Source Files</a><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <span class="el_package">org.apache.commons.release.plugin.mojos</span></div><h1>org.apach e.commons.release.plugin.mojos</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">255 of 990</td><td class="ctr2">74%</td><td class="bar">12 of 46</td><td class="ctr2">73%</td><td class="ctr1">10</td><td class="ctr2">42</td><td class="ctr1">32</td><td class="ctr2">181</td><td class="ctr1">0</td><td class="ctr2">19</td><td class="ctr1">0</td><td class="ctr2">3</td></tr></tfoot><tbody><tr><td id="a1"><a href="CommonsDistributionStagingMojo.html" class="el_class">CommonsDistributionStagingMojo</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="49" height="10" title="202" alt="202"/><img src="../jacoco-resources/greenbar.gif" width="70" height="10" title="289" alt="289"/></td><td class="ctr2" id="c2">58%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="60" height="10" title="9" alt="9"/><img src="../jacoco-resources/greenbar.gif" width="60" height="10" title="9" alt="9"/></td><td class="ctr2" id="e2">50%</td><t d class="ctr1" id="f0">7</td><td class="ctr2" id="g0">16</td><td class="ctr1" id="h0">24</td><td class="ctr2" id="i0">78</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">7</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a2"><a href="CommonsSiteCompressionMojo.html" class="el_class">CommonsSiteCompressionMojo</a></td><td class="bar" id="b1"><img src="../jacoco-resources/redbar.gif" width="9" height="10" title="37" alt="37"/><img src="../jacoco-resources/greenbar.gif" width="37" height="10" title="155" alt="155"/></td><td class="ctr2" id="c1">80%</td><td class="bar" id="d1"><img src="../jacoco-resources/redbar.gif" width="20" height="10" title="3" alt="3"/><img src="../jacoco-resources/greenbar.gif" width="73" height="10" title="11" alt="11"/></td><td class="ctr2" id="e1">78%</td><td class="ctr1" id="f1">3</td><td class="ctr2" id="g2">12</td><td class="ctr1" id="h1">6</td><td class="ctr2" id="i2">41</td><td class="ctr1" id="j1">0</td><td c lass="ctr2" id="k2">5</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a0"><a href="CommonsDistributionDetachmentMojo.html" class="el_class">CommonsDistributionDetachmentMojo</a></td><td class="bar" id="b2"><img src="../jacoco-resources/redbar.gif" width="3" height="10" title="16" alt="16"/><img src="../jacoco-resources/greenbar.gif" width="71" height="10" title="291" alt="291"/></td><td class="ctr2" id="c0">94%</td><td class="bar" id="d2"><img src="../jacoco-resources/greenbar.gif" width="93" height="10" title="14" alt="14"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g1">14</td><td class="ctr1" id="h2">2</td><td class="ctr2" id="i1">62</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k1">7</td><td class="ctr1" id="l2">0</td><td class="ctr2" id="m2">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155 </span></div></body></html> \ No newline at end of file
