You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2012/05/08 14:07:32 UTC
svn commit: r816565 [14/16] - in
/websites/production/maventest/content/plugins/maven-site-plugin-latest: ./
apidocs/ apidocs/org/apache/maven/plugins/site/
apidocs/org/apache/maven/plugins/site/class-use/
apidocs/org/apache/maven/plugins/site/wagon/ a...
Modified: websites/production/maventest/content/plugins/maven-site-plugin-latest/xref/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.html
==============================================================================
--- websites/production/maventest/content/plugins/maven-site-plugin-latest/xref/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.html (original)
+++ websites/production/maventest/content/plugins/maven-site-plugin-latest/xref/org/apache/maven/plugins/site/AbstractSiteRenderingMojo.html Tue May 8 12:07:26 2012
@@ -227,253 +227,250 @@
<a name="217" href="#217">217</a> MavenReport report = mavenReportExecution.getMavenReport();
<a name="218" href="#218">218</a> <strong class="jxr_keyword">try</strong>
<a name="219" href="#219">219</a> {
-<a name="220" href="#220">220</a> <strong class="jxr_keyword">if</strong> ( report.canGenerateReport() )
-<a name="221" href="#221">221</a> {
-<a name="222" href="#222">222</a> filteredReports.add( mavenReportExecution );
-<a name="223" href="#223">223</a> }
-<a name="224" href="#224">224</a> }
-<a name="225" href="#225">225</a> <strong class="jxr_keyword">catch</strong> ( AbstractMethodError e )
-<a name="226" href="#226">226</a> {
-<a name="227" href="#227">227</a> <em class="jxr_comment">// the canGenerateReport() has been added just before the 2.0 release and will cause all the reporting</em>
-<a name="228" href="#228">228</a> <em class="jxr_comment">// plugins with an earlier version to fail (most of the org.codehaus mojo now fails)</em>
-<a name="229" href="#229">229</a> <em class="jxr_comment">// be nice with them, output a warning and don't let them break anything</em>
-<a name="230" href="#230">230</a>
-<a name="231" href="#231">231</a> getLog().warn(
-<a name="232" href="#232">232</a> <span class="jxr_string">"Error loading report "</span> + report.getClass().getName()
-<a name="233" href="#233">233</a> + <span class="jxr_string">" - AbstractMethodError: canGenerateReport()"</span> );
-<a name="234" href="#234">234</a> filteredReports.add( mavenReportExecution );
-<a name="235" href="#235">235</a> }
-<a name="236" href="#236">236</a> }
-<a name="237" href="#237">237</a> <strong class="jxr_keyword">return</strong> filteredReports;
-<a name="238" href="#238">238</a> }
-<a name="239" href="#239">239</a>
-<a name="240" href="#240">240</a> <strong class="jxr_keyword">protected</strong> SiteRenderingContext createSiteRenderingContext( Locale locale )
-<a name="241" href="#241">241</a> <strong class="jxr_keyword">throws</strong> MojoExecutionException, IOException, MojoFailureException
-<a name="242" href="#242">242</a> {
-<a name="243" href="#243">243</a> <strong class="jxr_keyword">if</strong> ( attributes == <strong class="jxr_keyword">null</strong> )
-<a name="244" href="#244">244</a> {
-<a name="245" href="#245">245</a> attributes = <strong class="jxr_keyword">new</strong> HashMap<Object, Object>();
-<a name="246" href="#246">246</a> }
-<a name="247" href="#247">247</a>
-<a name="248" href="#248">248</a> <strong class="jxr_keyword">if</strong> ( attributes.get( <span class="jxr_string">"project"</span> ) == <strong class="jxr_keyword">null</strong> )
-<a name="249" href="#249">249</a> {
-<a name="250" href="#250">250</a> attributes.put( <span class="jxr_string">"project"</span>, project );
-<a name="251" href="#251">251</a> }
-<a name="252" href="#252">252</a>
-<a name="253" href="#253">253</a> <strong class="jxr_keyword">if</strong> ( attributes.get( <span class="jxr_string">"inputEncoding"</span> ) == <strong class="jxr_keyword">null</strong> )
-<a name="254" href="#254">254</a> {
-<a name="255" href="#255">255</a> attributes.put( <span class="jxr_string">"inputEncoding"</span>, getInputEncoding() );
-<a name="256" href="#256">256</a> }
-<a name="257" href="#257">257</a>
-<a name="258" href="#258">258</a> <strong class="jxr_keyword">if</strong> ( attributes.get( <span class="jxr_string">"outputEncoding"</span> ) == <strong class="jxr_keyword">null</strong> )
-<a name="259" href="#259">259</a> {
-<a name="260" href="#260">260</a> attributes.put( <span class="jxr_string">"outputEncoding"</span>, getOutputEncoding() );
-<a name="261" href="#261">261</a> }
-<a name="262" href="#262">262</a>
-<a name="263" href="#263">263</a> <em class="jxr_comment">// Put any of the properties in directly into the Velocity context</em>
-<a name="264" href="#264">264</a> attributes.putAll( project.getProperties() );
-<a name="265" href="#265">265</a>
-<a name="266" href="#266">266</a> DecorationModel decorationModel;
-<a name="267" href="#267">267</a> <strong class="jxr_keyword">try</strong>
-<a name="268" href="#268">268</a> {
-<a name="269" href="#269">269</a> decorationModel = siteTool.getDecorationModel( project, reactorProjects, localRepository, repositories,
-<a name="270" href="#270">270</a> toRelative( project.getBasedir(),
-<a name="271" href="#271">271</a> siteDirectory.getAbsolutePath() ),
-<a name="272" href="#272">272</a> locale, getInputEncoding(), getOutputEncoding() );
-<a name="273" href="#273">273</a> }
-<a name="274" href="#274">274</a> <strong class="jxr_keyword">catch</strong> ( SiteToolException e )
-<a name="275" href="#275">275</a> {
-<a name="276" href="#276">276</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"SiteToolException: "</span> + e.getMessage(), e );
-<a name="277" href="#277">277</a> }
-<a name="278" href="#278">278</a> <strong class="jxr_keyword">if</strong> ( template != <strong class="jxr_keyword">null</strong> )
-<a name="279" href="#279">279</a> {
-<a name="280" href="#280">280</a> <strong class="jxr_keyword">if</strong> ( templateFile != <strong class="jxr_keyword">null</strong> )
-<a name="281" href="#281">281</a> {
-<a name="282" href="#282">282</a> getLog().warn( <span class="jxr_string">"'template' configuration is ignored when 'templateFile' is set"</span> );
-<a name="283" href="#283">283</a> }
-<a name="284" href="#284">284</a> <strong class="jxr_keyword">else</strong>
-<a name="285" href="#285">285</a> {
-<a name="286" href="#286">286</a> templateFile = <strong class="jxr_keyword">new</strong> File( templateDirectory, template );
-<a name="287" href="#287">287</a> }
-<a name="288" href="#288">288</a> }
-<a name="289" href="#289">289</a>
-<a name="290" href="#290">290</a> File skinFile;
-<a name="291" href="#291">291</a> <strong class="jxr_keyword">try</strong>
-<a name="292" href="#292">292</a> {
-<a name="293" href="#293">293</a> Artifact skinArtifact =
-<a name="294" href="#294">294</a> siteTool.getSkinArtifactFromRepository( localRepository, repositories, decorationModel );
-<a name="295" href="#295">295</a> getLog().info( <span class="jxr_string">"Rendering site with "</span> + skinArtifact.getId() + <span class="jxr_string">" skin."</span> );
-<a name="296" href="#296">296</a>
-<a name="297" href="#297">297</a> skinFile = skinArtifact.getFile();
-<a name="298" href="#298">298</a> }
-<a name="299" href="#299">299</a> <strong class="jxr_keyword">catch</strong> ( SiteToolException e )
-<a name="300" href="#300">300</a> {
-<a name="301" href="#301">301</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"SiteToolException: "</span> + e.getMessage(), e );
-<a name="302" href="#302">302</a> }
-<a name="303" href="#303">303</a> SiteRenderingContext context;
-<a name="304" href="#304">304</a> <strong class="jxr_keyword">if</strong> ( templateFile != <strong class="jxr_keyword">null</strong> )
-<a name="305" href="#305">305</a> {
-<a name="306" href="#306">306</a> <strong class="jxr_keyword">if</strong> ( !templateFile.exists() )
-<a name="307" href="#307">307</a> {
-<a name="308" href="#308">308</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoFailureException( <span class="jxr_string">"Template file '"</span> + templateFile + <span class="jxr_string">"' does not exist"</span> );
-<a name="309" href="#309">309</a> }
-<a name="310" href="#310">310</a> context = siteRenderer.createContextForTemplate( templateFile, skinFile, attributes, decorationModel,
-<a name="311" href="#311">311</a> project.getName(), locale );
-<a name="312" href="#312">312</a> }
-<a name="313" href="#313">313</a> <strong class="jxr_keyword">else</strong>
-<a name="314" href="#314">314</a> {
-<a name="315" href="#315">315</a> context = siteRenderer.createContextForSkin( skinFile, attributes, decorationModel, project.getName(),
-<a name="316" href="#316">316</a> locale );
-<a name="317" href="#317">317</a> }
-<a name="318" href="#318">318</a>
-<a name="319" href="#319">319</a> <em class="jxr_comment">// Generate static site</em>
-<a name="320" href="#320">320</a> <strong class="jxr_keyword">if</strong> ( !locale.getLanguage().equals( Locale.getDefault().getLanguage() ) )
-<a name="321" href="#321">321</a> {
-<a name="322" href="#322">322</a> context.addSiteDirectory( <strong class="jxr_keyword">new</strong> File( siteDirectory, locale.getLanguage() ) );
-<a name="323" href="#323">323</a> context.addModuleDirectory( <strong class="jxr_keyword">new</strong> File( xdocDirectory, locale.getLanguage() ), <span class="jxr_string">"xdoc"</span> );
-<a name="324" href="#324">324</a> context.addModuleDirectory( <strong class="jxr_keyword">new</strong> File( xdocDirectory, locale.getLanguage() ), <span class="jxr_string">"fml"</span> );
-<a name="325" href="#325">325</a> }
-<a name="326" href="#326">326</a> <strong class="jxr_keyword">else</strong>
-<a name="327" href="#327">327</a> {
-<a name="328" href="#328">328</a> context.addSiteDirectory( siteDirectory );
-<a name="329" href="#329">329</a> context.addModuleDirectory( xdocDirectory, <span class="jxr_string">"xdoc"</span> );
-<a name="330" href="#330">330</a> context.addModuleDirectory( xdocDirectory, <span class="jxr_string">"fml"</span> );
-<a name="331" href="#331">331</a> }
-<a name="332" href="#332">332</a>
-<a name="333" href="#333">333</a> <strong class="jxr_keyword">if</strong> ( moduleExcludes != <strong class="jxr_keyword">null</strong> )
-<a name="334" href="#334">334</a> {
-<a name="335" href="#335">335</a> context.setModuleExcludes( moduleExcludes );
-<a name="336" href="#336">336</a> }
+<a name="220" href="#220">220</a> filteredReports.add( mavenReportExecution );
+<a name="221" href="#221">221</a> }
+<a name="222" href="#222">222</a> <strong class="jxr_keyword">catch</strong> ( AbstractMethodError e )
+<a name="223" href="#223">223</a> {
+<a name="224" href="#224">224</a> <em class="jxr_comment">// the canGenerateReport() has been added just before the 2.0 release and will cause all the reporting</em>
+<a name="225" href="#225">225</a> <em class="jxr_comment">// plugins with an earlier version to fail (most of the org.codehaus mojo now fails)</em>
+<a name="226" href="#226">226</a> <em class="jxr_comment">// be nice with them, output a warning and don't let them break anything</em>
+<a name="227" href="#227">227</a>
+<a name="228" href="#228">228</a> getLog().warn(
+<a name="229" href="#229">229</a> <span class="jxr_string">"Error loading report "</span> + report.getClass().getName()
+<a name="230" href="#230">230</a> + <span class="jxr_string">" - AbstractMethodError: canGenerateReport()"</span> );
+<a name="231" href="#231">231</a> filteredReports.add( mavenReportExecution );
+<a name="232" href="#232">232</a> }
+<a name="233" href="#233">233</a> }
+<a name="234" href="#234">234</a> <strong class="jxr_keyword">return</strong> filteredReports;
+<a name="235" href="#235">235</a> }
+<a name="236" href="#236">236</a>
+<a name="237" href="#237">237</a> <strong class="jxr_keyword">protected</strong> SiteRenderingContext createSiteRenderingContext( Locale locale )
+<a name="238" href="#238">238</a> <strong class="jxr_keyword">throws</strong> MojoExecutionException, IOException, MojoFailureException
+<a name="239" href="#239">239</a> {
+<a name="240" href="#240">240</a> <strong class="jxr_keyword">if</strong> ( attributes == <strong class="jxr_keyword">null</strong> )
+<a name="241" href="#241">241</a> {
+<a name="242" href="#242">242</a> attributes = <strong class="jxr_keyword">new</strong> HashMap<Object, Object>();
+<a name="243" href="#243">243</a> }
+<a name="244" href="#244">244</a>
+<a name="245" href="#245">245</a> <strong class="jxr_keyword">if</strong> ( attributes.get( <span class="jxr_string">"project"</span> ) == <strong class="jxr_keyword">null</strong> )
+<a name="246" href="#246">246</a> {
+<a name="247" href="#247">247</a> attributes.put( <span class="jxr_string">"project"</span>, project );
+<a name="248" href="#248">248</a> }
+<a name="249" href="#249">249</a>
+<a name="250" href="#250">250</a> <strong class="jxr_keyword">if</strong> ( attributes.get( <span class="jxr_string">"inputEncoding"</span> ) == <strong class="jxr_keyword">null</strong> )
+<a name="251" href="#251">251</a> {
+<a name="252" href="#252">252</a> attributes.put( <span class="jxr_string">"inputEncoding"</span>, getInputEncoding() );
+<a name="253" href="#253">253</a> }
+<a name="254" href="#254">254</a>
+<a name="255" href="#255">255</a> <strong class="jxr_keyword">if</strong> ( attributes.get( <span class="jxr_string">"outputEncoding"</span> ) == <strong class="jxr_keyword">null</strong> )
+<a name="256" href="#256">256</a> {
+<a name="257" href="#257">257</a> attributes.put( <span class="jxr_string">"outputEncoding"</span>, getOutputEncoding() );
+<a name="258" href="#258">258</a> }
+<a name="259" href="#259">259</a>
+<a name="260" href="#260">260</a> <em class="jxr_comment">// Put any of the properties in directly into the Velocity context</em>
+<a name="261" href="#261">261</a> attributes.putAll( project.getProperties() );
+<a name="262" href="#262">262</a>
+<a name="263" href="#263">263</a> DecorationModel decorationModel;
+<a name="264" href="#264">264</a> <strong class="jxr_keyword">try</strong>
+<a name="265" href="#265">265</a> {
+<a name="266" href="#266">266</a> decorationModel = siteTool.getDecorationModel( project, reactorProjects, localRepository, repositories,
+<a name="267" href="#267">267</a> toRelative( project.getBasedir(),
+<a name="268" href="#268">268</a> siteDirectory.getAbsolutePath() ),
+<a name="269" href="#269">269</a> locale, getInputEncoding(), getOutputEncoding() );
+<a name="270" href="#270">270</a> }
+<a name="271" href="#271">271</a> <strong class="jxr_keyword">catch</strong> ( SiteToolException e )
+<a name="272" href="#272">272</a> {
+<a name="273" href="#273">273</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"SiteToolException: "</span> + e.getMessage(), e );
+<a name="274" href="#274">274</a> }
+<a name="275" href="#275">275</a> <strong class="jxr_keyword">if</strong> ( template != <strong class="jxr_keyword">null</strong> )
+<a name="276" href="#276">276</a> {
+<a name="277" href="#277">277</a> <strong class="jxr_keyword">if</strong> ( templateFile != <strong class="jxr_keyword">null</strong> )
+<a name="278" href="#278">278</a> {
+<a name="279" href="#279">279</a> getLog().warn( <span class="jxr_string">"'template' configuration is ignored when 'templateFile' is set"</span> );
+<a name="280" href="#280">280</a> }
+<a name="281" href="#281">281</a> <strong class="jxr_keyword">else</strong>
+<a name="282" href="#282">282</a> {
+<a name="283" href="#283">283</a> templateFile = <strong class="jxr_keyword">new</strong> File( templateDirectory, template );
+<a name="284" href="#284">284</a> }
+<a name="285" href="#285">285</a> }
+<a name="286" href="#286">286</a>
+<a name="287" href="#287">287</a> File skinFile;
+<a name="288" href="#288">288</a> <strong class="jxr_keyword">try</strong>
+<a name="289" href="#289">289</a> {
+<a name="290" href="#290">290</a> Artifact skinArtifact =
+<a name="291" href="#291">291</a> siteTool.getSkinArtifactFromRepository( localRepository, repositories, decorationModel );
+<a name="292" href="#292">292</a> getLog().info( <span class="jxr_string">"Rendering site with "</span> + skinArtifact.getId() + <span class="jxr_string">" skin."</span> );
+<a name="293" href="#293">293</a>
+<a name="294" href="#294">294</a> skinFile = skinArtifact.getFile();
+<a name="295" href="#295">295</a> }
+<a name="296" href="#296">296</a> <strong class="jxr_keyword">catch</strong> ( SiteToolException e )
+<a name="297" href="#297">297</a> {
+<a name="298" href="#298">298</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoExecutionException( <span class="jxr_string">"SiteToolException: "</span> + e.getMessage(), e );
+<a name="299" href="#299">299</a> }
+<a name="300" href="#300">300</a> SiteRenderingContext context;
+<a name="301" href="#301">301</a> <strong class="jxr_keyword">if</strong> ( templateFile != <strong class="jxr_keyword">null</strong> )
+<a name="302" href="#302">302</a> {
+<a name="303" href="#303">303</a> <strong class="jxr_keyword">if</strong> ( !templateFile.exists() )
+<a name="304" href="#304">304</a> {
+<a name="305" href="#305">305</a> <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> MojoFailureException( <span class="jxr_string">"Template file '"</span> + templateFile + <span class="jxr_string">"' does not exist"</span> );
+<a name="306" href="#306">306</a> }
+<a name="307" href="#307">307</a> context = siteRenderer.createContextForTemplate( templateFile, skinFile, attributes, decorationModel,
+<a name="308" href="#308">308</a> project.getName(), locale );
+<a name="309" href="#309">309</a> }
+<a name="310" href="#310">310</a> <strong class="jxr_keyword">else</strong>
+<a name="311" href="#311">311</a> {
+<a name="312" href="#312">312</a> context = siteRenderer.createContextForSkin( skinFile, attributes, decorationModel, project.getName(),
+<a name="313" href="#313">313</a> locale );
+<a name="314" href="#314">314</a> }
+<a name="315" href="#315">315</a>
+<a name="316" href="#316">316</a> <em class="jxr_comment">// Generate static site</em>
+<a name="317" href="#317">317</a> <strong class="jxr_keyword">if</strong> ( !locale.getLanguage().equals( Locale.getDefault().getLanguage() ) )
+<a name="318" href="#318">318</a> {
+<a name="319" href="#319">319</a> context.addSiteDirectory( <strong class="jxr_keyword">new</strong> File( siteDirectory, locale.getLanguage() ) );
+<a name="320" href="#320">320</a> context.addModuleDirectory( <strong class="jxr_keyword">new</strong> File( xdocDirectory, locale.getLanguage() ), <span class="jxr_string">"xdoc"</span> );
+<a name="321" href="#321">321</a> context.addModuleDirectory( <strong class="jxr_keyword">new</strong> File( xdocDirectory, locale.getLanguage() ), <span class="jxr_string">"fml"</span> );
+<a name="322" href="#322">322</a> }
+<a name="323" href="#323">323</a> <strong class="jxr_keyword">else</strong>
+<a name="324" href="#324">324</a> {
+<a name="325" href="#325">325</a> context.addSiteDirectory( siteDirectory );
+<a name="326" href="#326">326</a> context.addModuleDirectory( xdocDirectory, <span class="jxr_string">"xdoc"</span> );
+<a name="327" href="#327">327</a> context.addModuleDirectory( xdocDirectory, <span class="jxr_string">"fml"</span> );
+<a name="328" href="#328">328</a> }
+<a name="329" href="#329">329</a>
+<a name="330" href="#330">330</a> <strong class="jxr_keyword">if</strong> ( moduleExcludes != <strong class="jxr_keyword">null</strong> )
+<a name="331" href="#331">331</a> {
+<a name="332" href="#332">332</a> context.setModuleExcludes( moduleExcludes );
+<a name="333" href="#333">333</a> }
+<a name="334" href="#334">334</a>
+<a name="335" href="#335">335</a> <strong class="jxr_keyword">return</strong> context;
+<a name="336" href="#336">336</a> }
<a name="337" href="#337">337</a>
-<a name="338" href="#338">338</a> <strong class="jxr_keyword">return</strong> context;
-<a name="339" href="#339">339</a> }
-<a name="340" href="#340">340</a>
-<a name="341" href="#341">341</a> <em class="jxr_javadoccomment">/**</em>
-<a name="342" href="#342">342</a> <em class="jxr_javadoccomment"> * Go through the list of reports and process each one like this:</em>
-<a name="343" href="#343">343</a> <em class="jxr_javadoccomment"> * <ul></em>
-<a name="344" href="#344">344</a> <em class="jxr_javadoccomment"> * <li>Add the report to a map of reports keyed by filename having the report itself as value</em>
-<a name="345" href="#345">345</a> <em class="jxr_javadoccomment"> * <li>If the report is not yet in the map of documents, add it together with a suitable renderer</em>
-<a name="346" href="#346">346</a> <em class="jxr_javadoccomment"> * </ul></em>
-<a name="347" href="#347">347</a> <em class="jxr_javadoccomment"> *</em>
-<a name="348" href="#348">348</a> <em class="jxr_javadoccomment"> * @param reports A List of MavenReports</em>
-<a name="349" href="#349">349</a> <em class="jxr_javadoccomment"> * @param documents A Map of documents, keyed by filename</em>
-<a name="350" href="#350">350</a> <em class="jxr_javadoccomment"> * @param locale the Locale the reports are processed for.</em>
-<a name="351" href="#351">351</a> <em class="jxr_javadoccomment"> * @return A map with all reports keyed by filename having the report itself as value.</em>
-<a name="352" href="#352">352</a> <em class="jxr_javadoccomment"> * The map will be used to populate a menu.</em>
-<a name="353" href="#353">353</a> <em class="jxr_javadoccomment"> */</em>
-<a name="354" href="#354">354</a> <strong class="jxr_keyword">protected</strong> Map<String, MavenReport> locateReports( List<MavenReportExecution> reports,
-<a name="355" href="#355">355</a> Map<String, DocumentRenderer> documents, Locale locale )
-<a name="356" href="#356">356</a> {
-<a name="357" href="#357">357</a> <em class="jxr_comment">// copy Collection to prevent ConcurrentModificationException</em>
-<a name="358" href="#358">358</a> List<MavenReportExecution> filtered = <strong class="jxr_keyword">new</strong> ArrayList<MavenReportExecution>( reports );
-<a name="359" href="#359">359</a>
-<a name="360" href="#360">360</a> Map<String, MavenReport> reportsByOutputName = <strong class="jxr_keyword">new</strong> HashMap<String, MavenReport>();
-<a name="361" href="#361">361</a> <strong class="jxr_keyword">for</strong> ( MavenReportExecution mavenReportExecution : filtered )
-<a name="362" href="#362">362</a> {
-<a name="363" href="#363">363</a> MavenReport report = mavenReportExecution.getMavenReport();
-<a name="364" href="#364">364</a>
-<a name="365" href="#365">365</a> String outputName = report.getOutputName() + <span class="jxr_string">".html"</span>;
+<a name="338" href="#338">338</a> <em class="jxr_javadoccomment">/**</em>
+<a name="339" href="#339">339</a> <em class="jxr_javadoccomment"> * Go through the list of reports and process each one like this:</em>
+<a name="340" href="#340">340</a> <em class="jxr_javadoccomment"> * <ul></em>
+<a name="341" href="#341">341</a> <em class="jxr_javadoccomment"> * <li>Add the report to a map of reports keyed by filename having the report itself as value</em>
+<a name="342" href="#342">342</a> <em class="jxr_javadoccomment"> * <li>If the report is not yet in the map of documents, add it together with a suitable renderer</em>
+<a name="343" href="#343">343</a> <em class="jxr_javadoccomment"> * </ul></em>
+<a name="344" href="#344">344</a> <em class="jxr_javadoccomment"> *</em>
+<a name="345" href="#345">345</a> <em class="jxr_javadoccomment"> * @param reports A List of MavenReports</em>
+<a name="346" href="#346">346</a> <em class="jxr_javadoccomment"> * @param documents A Map of documents, keyed by filename</em>
+<a name="347" href="#347">347</a> <em class="jxr_javadoccomment"> * @param locale the Locale the reports are processed for.</em>
+<a name="348" href="#348">348</a> <em class="jxr_javadoccomment"> * @return A map with all reports keyed by filename having the report itself as value.</em>
+<a name="349" href="#349">349</a> <em class="jxr_javadoccomment"> * The map will be used to populate a menu.</em>
+<a name="350" href="#350">350</a> <em class="jxr_javadoccomment"> */</em>
+<a name="351" href="#351">351</a> <strong class="jxr_keyword">protected</strong> Map<String, MavenReport> locateReports( List<MavenReportExecution> reports,
+<a name="352" href="#352">352</a> Map<String, DocumentRenderer> documents, Locale locale )
+<a name="353" href="#353">353</a> {
+<a name="354" href="#354">354</a> <em class="jxr_comment">// copy Collection to prevent ConcurrentModificationException</em>
+<a name="355" href="#355">355</a> List<MavenReportExecution> filtered = <strong class="jxr_keyword">new</strong> ArrayList<MavenReportExecution>( reports );
+<a name="356" href="#356">356</a>
+<a name="357" href="#357">357</a> Map<String, MavenReport> reportsByOutputName = <strong class="jxr_keyword">new</strong> HashMap<String, MavenReport>();
+<a name="358" href="#358">358</a> <strong class="jxr_keyword">for</strong> ( MavenReportExecution mavenReportExecution : filtered )
+<a name="359" href="#359">359</a> {
+<a name="360" href="#360">360</a> MavenReport report = mavenReportExecution.getMavenReport();
+<a name="361" href="#361">361</a>
+<a name="362" href="#362">362</a> String outputName = report.getOutputName() + <span class="jxr_string">".html"</span>;
+<a name="363" href="#363">363</a>
+<a name="364" href="#364">364</a> <em class="jxr_comment">// Always add the report to the menu, see MSITE-150</em>
+<a name="365" href="#365">365</a> reportsByOutputName.put( report.getOutputName(), report );
<a name="366" href="#366">366</a>
-<a name="367" href="#367">367</a> <em class="jxr_comment">// Always add the report to the menu, see MSITE-150</em>
-<a name="368" href="#368">368</a> reportsByOutputName.put( report.getOutputName(), report );
-<a name="369" href="#369">369</a>
-<a name="370" href="#370">370</a> <strong class="jxr_keyword">if</strong> ( documents.containsKey( outputName ) )
-<a name="371" href="#371">371</a> {
-<a name="372" href="#372">372</a> String displayLanguage = locale.getDisplayLanguage( Locale.ENGLISH );
-<a name="373" href="#373">373</a>
-<a name="374" href="#374">374</a> getLog().info( <span class="jxr_string">"Skipped \""</span> + report.getName( locale ) + <span class="jxr_string">"\" report, file \""</span> + outputName
-<a name="375" href="#375">375</a> + <span class="jxr_string">"\" already exists for the "</span> + displayLanguage + <span class="jxr_string">" version."</span> );
-<a name="376" href="#376">376</a> reports.remove( mavenReportExecution );
-<a name="377" href="#377">377</a> }
-<a name="378" href="#378">378</a> <strong class="jxr_keyword">else</strong>
-<a name="379" href="#379">379</a> {
-<a name="380" href="#380">380</a> RenderingContext renderingContext = <strong class="jxr_keyword">new</strong> RenderingContext( siteDirectory, outputName );
-<a name="381" href="#381">381</a> DocumentRenderer renderer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/plugins/site/ReportDocumentRenderer.html">ReportDocumentRenderer</a>( mavenReportExecution, renderingContext, getLog() );
-<a name="382" href="#382">382</a> documents.put( outputName, renderer );
-<a name="383" href="#383">383</a> }
-<a name="384" href="#384">384</a> }
-<a name="385" href="#385">385</a> <strong class="jxr_keyword">return</strong> reportsByOutputName;
-<a name="386" href="#386">386</a> }
-<a name="387" href="#387">387</a>
-<a name="388" href="#388">388</a> <em class="jxr_javadoccomment">/**</em>
-<a name="389" href="#389">389</a> <em class="jxr_javadoccomment"> * Go through the collection of reports and put each report into a list for the appropriate category. The list is</em>
-<a name="390" href="#390">390</a> <em class="jxr_javadoccomment"> * put into a map keyed by the name of the category.</em>
-<a name="391" href="#391">391</a> <em class="jxr_javadoccomment"> *</em>
-<a name="392" href="#392">392</a> <em class="jxr_javadoccomment"> * @param reports A Collection of MavenReports</em>
-<a name="393" href="#393">393</a> <em class="jxr_javadoccomment"> * @return A map keyed category having the report itself as value</em>
-<a name="394" href="#394">394</a> <em class="jxr_javadoccomment"> */</em>
-<a name="395" href="#395">395</a> <strong class="jxr_keyword">protected</strong> Map<String, List<MavenReport>> categoriseReports( Collection<MavenReport> reports )
-<a name="396" href="#396">396</a> {
-<a name="397" href="#397">397</a> Map<String, List<MavenReport>> categories = <strong class="jxr_keyword">new</strong> HashMap<String, List<MavenReport>>();
-<a name="398" href="#398">398</a> <strong class="jxr_keyword">for</strong> ( MavenReport report : reports )
-<a name="399" href="#399">399</a> {
-<a name="400" href="#400">400</a> List<MavenReport> categoryReports = categories.get( report.getCategoryName() );
-<a name="401" href="#401">401</a> <strong class="jxr_keyword">if</strong> ( categoryReports == <strong class="jxr_keyword">null</strong> )
-<a name="402" href="#402">402</a> {
-<a name="403" href="#403">403</a> categoryReports = <strong class="jxr_keyword">new</strong> ArrayList<MavenReport>();
-<a name="404" href="#404">404</a> categories.put( report.getCategoryName(), categoryReports );
-<a name="405" href="#405">405</a> }
-<a name="406" href="#406">406</a> categoryReports.add( report );
-<a name="407" href="#407">407</a> }
-<a name="408" href="#408">408</a> <strong class="jxr_keyword">return</strong> categories;
-<a name="409" href="#409">409</a> }
-<a name="410" href="#410">410</a>
-<a name="411" href="#411">411</a> <strong class="jxr_keyword">protected</strong> Map<String, DocumentRenderer> locateDocuments( SiteRenderingContext context, List<MavenReportExecution> reports, Locale locale )
-<a name="412" href="#412">412</a> <strong class="jxr_keyword">throws</strong> IOException, RendererException
-<a name="413" href="#413">413</a> {
-<a name="414" href="#414">414</a> Map<String, DocumentRenderer> documents = siteRenderer.locateDocumentFiles( context );
-<a name="415" href="#415">415</a>
-<a name="416" href="#416">416</a> Map<String, MavenReport> reportsByOutputName = locateReports( reports, documents, locale );
+<a name="367" href="#367">367</a> <strong class="jxr_keyword">if</strong> ( documents.containsKey( outputName ) )
+<a name="368" href="#368">368</a> {
+<a name="369" href="#369">369</a> String displayLanguage = locale.getDisplayLanguage( Locale.ENGLISH );
+<a name="370" href="#370">370</a>
+<a name="371" href="#371">371</a> getLog().info( <span class="jxr_string">"Skipped \""</span> + report.getName( locale ) + <span class="jxr_string">"\" report, file \""</span> + outputName
+<a name="372" href="#372">372</a> + <span class="jxr_string">"\" already exists for the "</span> + displayLanguage + <span class="jxr_string">" version."</span> );
+<a name="373" href="#373">373</a> reports.remove( mavenReportExecution );
+<a name="374" href="#374">374</a> }
+<a name="375" href="#375">375</a> <strong class="jxr_keyword">else</strong>
+<a name="376" href="#376">376</a> {
+<a name="377" href="#377">377</a> RenderingContext renderingContext = <strong class="jxr_keyword">new</strong> RenderingContext( siteDirectory, outputName );
+<a name="378" href="#378">378</a> DocumentRenderer renderer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/plugins/site/ReportDocumentRenderer.html">ReportDocumentRenderer</a>( mavenReportExecution, renderingContext, getLog() );
+<a name="379" href="#379">379</a> documents.put( outputName, renderer );
+<a name="380" href="#380">380</a> }
+<a name="381" href="#381">381</a> }
+<a name="382" href="#382">382</a> <strong class="jxr_keyword">return</strong> reportsByOutputName;
+<a name="383" href="#383">383</a> }
+<a name="384" href="#384">384</a>
+<a name="385" href="#385">385</a> <em class="jxr_javadoccomment">/**</em>
+<a name="386" href="#386">386</a> <em class="jxr_javadoccomment"> * Go through the collection of reports and put each report into a list for the appropriate category. The list is</em>
+<a name="387" href="#387">387</a> <em class="jxr_javadoccomment"> * put into a map keyed by the name of the category.</em>
+<a name="388" href="#388">388</a> <em class="jxr_javadoccomment"> *</em>
+<a name="389" href="#389">389</a> <em class="jxr_javadoccomment"> * @param reports A Collection of MavenReports</em>
+<a name="390" href="#390">390</a> <em class="jxr_javadoccomment"> * @return A map keyed category having the report itself as value</em>
+<a name="391" href="#391">391</a> <em class="jxr_javadoccomment"> */</em>
+<a name="392" href="#392">392</a> <strong class="jxr_keyword">protected</strong> Map<String, List<MavenReport>> categoriseReports( Collection<MavenReport> reports )
+<a name="393" href="#393">393</a> {
+<a name="394" href="#394">394</a> Map<String, List<MavenReport>> categories = <strong class="jxr_keyword">new</strong> HashMap<String, List<MavenReport>>();
+<a name="395" href="#395">395</a> <strong class="jxr_keyword">for</strong> ( MavenReport report : reports )
+<a name="396" href="#396">396</a> {
+<a name="397" href="#397">397</a> List<MavenReport> categoryReports = categories.get( report.getCategoryName() );
+<a name="398" href="#398">398</a> <strong class="jxr_keyword">if</strong> ( categoryReports == <strong class="jxr_keyword">null</strong> )
+<a name="399" href="#399">399</a> {
+<a name="400" href="#400">400</a> categoryReports = <strong class="jxr_keyword">new</strong> ArrayList<MavenReport>();
+<a name="401" href="#401">401</a> categories.put( report.getCategoryName(), categoryReports );
+<a name="402" href="#402">402</a> }
+<a name="403" href="#403">403</a> categoryReports.add( report );
+<a name="404" href="#404">404</a> }
+<a name="405" href="#405">405</a> <strong class="jxr_keyword">return</strong> categories;
+<a name="406" href="#406">406</a> }
+<a name="407" href="#407">407</a>
+<a name="408" href="#408">408</a> <strong class="jxr_keyword">protected</strong> Map<String, DocumentRenderer> locateDocuments( SiteRenderingContext context, List<MavenReportExecution> reports, Locale locale )
+<a name="409" href="#409">409</a> <strong class="jxr_keyword">throws</strong> IOException, RendererException
+<a name="410" href="#410">410</a> {
+<a name="411" href="#411">411</a> Map<String, DocumentRenderer> documents = siteRenderer.locateDocumentFiles( context );
+<a name="412" href="#412">412</a>
+<a name="413" href="#413">413</a> Map<String, MavenReport> reportsByOutputName = locateReports( reports, documents, locale );
+<a name="414" href="#414">414</a>
+<a name="415" href="#415">415</a> <em class="jxr_comment">// TODO: I want to get rid of categories eventually. There's no way to add your own in a fully i18n manner</em>
+<a name="416" href="#416">416</a> Map<String, List<MavenReport>> categories = categoriseReports( reportsByOutputName.values() );
<a name="417" href="#417">417</a>
-<a name="418" href="#418">418</a> <em class="jxr_comment">// TODO: I want to get rid of categories eventually. There's no way to add your own in a fully i18n manner</em>
-<a name="419" href="#419">419</a> Map<String, List<MavenReport>> categories = categoriseReports( reportsByOutputName.values() );
+<a name="418" href="#418">418</a> siteTool.populateReportsMenu( context.getDecoration(), locale, categories );
+<a name="419" href="#419">419</a> populateReportItems( context.getDecoration(), locale, reportsByOutputName );
<a name="420" href="#420">420</a>
-<a name="421" href="#421">421</a> siteTool.populateReportsMenu( context.getDecoration(), locale, categories );
-<a name="422" href="#422">422</a> populateReportItems( context.getDecoration(), locale, reportsByOutputName );
-<a name="423" href="#423">423</a>
-<a name="424" href="#424">424</a> <strong class="jxr_keyword">if</strong> ( categories.containsKey( MavenReport.CATEGORY_PROJECT_INFORMATION ) )
-<a name="425" href="#425">425</a> {
-<a name="426" href="#426">426</a> List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION );
-<a name="427" href="#427">427</a>
-<a name="428" href="#428">428</a> RenderingContext renderingContext = <strong class="jxr_keyword">new</strong> RenderingContext( siteDirectory, <span class="jxr_string">"project-info.html"</span> );
-<a name="429" href="#429">429</a> String title = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.information.title"</span> );
-<a name="430" href="#430">430</a> String desc1 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.information.description1"</span> );
-<a name="431" href="#431">431</a> String desc2 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.information.description2"</span> );
-<a name="432" href="#432">432</a> DocumentRenderer renderer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/plugins/site/CategorySummaryDocumentRenderer.html">CategorySummaryDocumentRenderer</a>( renderingContext, title, desc1, desc2,
-<a name="433" href="#433">433</a> i18n, categoryReports, getLog() );
-<a name="434" href="#434">434</a>
-<a name="435" href="#435">435</a> <strong class="jxr_keyword">if</strong> ( !documents.containsKey( renderer.getOutputName() ) )
-<a name="436" href="#436">436</a> {
-<a name="437" href="#437">437</a> documents.put( renderer.getOutputName(), renderer );
-<a name="438" href="#438">438</a> }
-<a name="439" href="#439">439</a> <strong class="jxr_keyword">else</strong>
-<a name="440" href="#440">440</a> {
-<a name="441" href="#441">441</a> getLog().info( <span class="jxr_string">"Category summary '"</span> + renderer.getOutputName() + <span class="jxr_string">"' skipped; already exists"</span> );
-<a name="442" href="#442">442</a> }
-<a name="443" href="#443">443</a> }
-<a name="444" href="#444">444</a>
-<a name="445" href="#445">445</a> <strong class="jxr_keyword">if</strong> ( categories.containsKey( MavenReport.CATEGORY_PROJECT_REPORTS ) )
-<a name="446" href="#446">446</a> {
-<a name="447" href="#447">447</a> List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_REPORTS );
-<a name="448" href="#448">448</a> RenderingContext renderingContext = <strong class="jxr_keyword">new</strong> RenderingContext( siteDirectory, <span class="jxr_string">"project-reports.html"</span> );
-<a name="449" href="#449">449</a> String title = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.project.title"</span> );
-<a name="450" href="#450">450</a> String desc1 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.project.description1"</span> );
-<a name="451" href="#451">451</a> String desc2 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.project.description2"</span> );
-<a name="452" href="#452">452</a> DocumentRenderer renderer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/plugins/site/CategorySummaryDocumentRenderer.html">CategorySummaryDocumentRenderer</a>( renderingContext, title, desc1, desc2,
-<a name="453" href="#453">453</a> i18n, categoryReports, getLog() );
-<a name="454" href="#454">454</a>
-<a name="455" href="#455">455</a> <strong class="jxr_keyword">if</strong> ( !documents.containsKey( renderer.getOutputName() ) )
-<a name="456" href="#456">456</a> {
-<a name="457" href="#457">457</a> documents.put( renderer.getOutputName(), renderer );
-<a name="458" href="#458">458</a> }
-<a name="459" href="#459">459</a> <strong class="jxr_keyword">else</strong>
-<a name="460" href="#460">460</a> {
-<a name="461" href="#461">461</a> getLog().info( <span class="jxr_string">"Category summary '"</span> + renderer.getOutputName() + <span class="jxr_string">"' skipped; already exists"</span> );
-<a name="462" href="#462">462</a> }
-<a name="463" href="#463">463</a> }
-<a name="464" href="#464">464</a> <strong class="jxr_keyword">return</strong> documents;
-<a name="465" href="#465">465</a> }
-<a name="466" href="#466">466</a> }
+<a name="421" href="#421">421</a> <strong class="jxr_keyword">if</strong> ( categories.containsKey( MavenReport.CATEGORY_PROJECT_INFORMATION ) )
+<a name="422" href="#422">422</a> {
+<a name="423" href="#423">423</a> List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_INFORMATION );
+<a name="424" href="#424">424</a>
+<a name="425" href="#425">425</a> RenderingContext renderingContext = <strong class="jxr_keyword">new</strong> RenderingContext( siteDirectory, <span class="jxr_string">"project-info.html"</span> );
+<a name="426" href="#426">426</a> String title = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.information.title"</span> );
+<a name="427" href="#427">427</a> String desc1 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.information.description1"</span> );
+<a name="428" href="#428">428</a> String desc2 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.information.description2"</span> );
+<a name="429" href="#429">429</a> DocumentRenderer renderer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/plugins/site/CategorySummaryDocumentRenderer.html">CategorySummaryDocumentRenderer</a>( renderingContext, title, desc1, desc2,
+<a name="430" href="#430">430</a> i18n, categoryReports, getLog() );
+<a name="431" href="#431">431</a>
+<a name="432" href="#432">432</a> <strong class="jxr_keyword">if</strong> ( !documents.containsKey( renderer.getOutputName() ) )
+<a name="433" href="#433">433</a> {
+<a name="434" href="#434">434</a> documents.put( renderer.getOutputName(), renderer );
+<a name="435" href="#435">435</a> }
+<a name="436" href="#436">436</a> <strong class="jxr_keyword">else</strong>
+<a name="437" href="#437">437</a> {
+<a name="438" href="#438">438</a> getLog().info( <span class="jxr_string">"Category summary '"</span> + renderer.getOutputName() + <span class="jxr_string">"' skipped; already exists"</span> );
+<a name="439" href="#439">439</a> }
+<a name="440" href="#440">440</a> }
+<a name="441" href="#441">441</a>
+<a name="442" href="#442">442</a> <strong class="jxr_keyword">if</strong> ( categories.containsKey( MavenReport.CATEGORY_PROJECT_REPORTS ) )
+<a name="443" href="#443">443</a> {
+<a name="444" href="#444">444</a> List<MavenReport> categoryReports = categories.get( MavenReport.CATEGORY_PROJECT_REPORTS );
+<a name="445" href="#445">445</a> RenderingContext renderingContext = <strong class="jxr_keyword">new</strong> RenderingContext( siteDirectory, <span class="jxr_string">"project-reports.html"</span> );
+<a name="446" href="#446">446</a> String title = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.project.title"</span> );
+<a name="447" href="#447">447</a> String desc1 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.project.description1"</span> );
+<a name="448" href="#448">448</a> String desc2 = i18n.getString( <span class="jxr_string">"site-plugin"</span>, locale, <span class="jxr_string">"report.project.description2"</span> );
+<a name="449" href="#449">449</a> DocumentRenderer renderer = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/plugins/site/CategorySummaryDocumentRenderer.html">CategorySummaryDocumentRenderer</a>( renderingContext, title, desc1, desc2,
+<a name="450" href="#450">450</a> i18n, categoryReports, getLog() );
+<a name="451" href="#451">451</a>
+<a name="452" href="#452">452</a> <strong class="jxr_keyword">if</strong> ( !documents.containsKey( renderer.getOutputName() ) )
+<a name="453" href="#453">453</a> {
+<a name="454" href="#454">454</a> documents.put( renderer.getOutputName(), renderer );
+<a name="455" href="#455">455</a> }
+<a name="456" href="#456">456</a> <strong class="jxr_keyword">else</strong>
+<a name="457" href="#457">457</a> {
+<a name="458" href="#458">458</a> getLog().info( <span class="jxr_string">"Category summary '"</span> + renderer.getOutputName() + <span class="jxr_string">"' skipped; already exists"</span> );
+<a name="459" href="#459">459</a> }
+<a name="460" href="#460">460</a> }
+<a name="461" href="#461">461</a> <strong class="jxr_keyword">return</strong> documents;
+<a name="462" href="#462">462</a> }
+<a name="463" href="#463">463</a> }
</pre>
<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
</html>