You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@commons.apache.org by ch...@apache.org on 2019/09/02 19:25:04 UTC

svn commit: r1049536 [4/22] - in /websites/production/commons/content/proper/commons-release-plugin: ./ apidocs/ apidocs/org/apache/commons/release/plugin/ apidocs/org/apache/commons/release/plugin/class-use/ apidocs/org/apache/commons/release/plugin/m...

Modified: websites/production/commons/content/proper/commons-release-plugin/apidocs/src-html/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.html
==============================================================================
--- websites/production/commons/content/proper/commons-release-plugin/apidocs/src-html/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.html (original)
+++ websites/production/commons/content/proper/commons-release-plugin/apidocs/src-html/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.html Mon Sep  2 19:25:02 2019
@@ -208,291 +208,292 @@
 <span class="sourceLineNo">200</span>        }<a name="line.200"></a>
 <span class="sourceLineNo">201</span>        getLog().info("Preparing to stage distributions");<a name="line.201"></a>
 <span class="sourceLineNo">202</span>        try {<a name="line.202"></a>
-<span class="sourceLineNo">203</span>            ScmManager scmManager = new BasicScmManager();<a name="line.203"></a>
+<span class="sourceLineNo">203</span>            final ScmManager scmManager = new BasicScmManager();<a name="line.203"></a>
 <span class="sourceLineNo">204</span>            scmManager.setScmProvider("svn", new SvnExeScmProvider());<a name="line.204"></a>
-<span class="sourceLineNo">205</span>            ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);<a name="line.205"></a>
-<span class="sourceLineNo">206</span>            ScmProvider provider = scmManager.getProviderByRepository(repository);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>            SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository.getProviderRepository();<a name="line.207"></a>
-<span class="sourceLineNo">208</span>            SharedFunctions.setAuthentication(<a name="line.208"></a>
-<span class="sourceLineNo">209</span>                    providerRepository,<a name="line.209"></a>
-<span class="sourceLineNo">210</span>                    distServer,<a name="line.210"></a>
-<span class="sourceLineNo">211</span>                    settings,<a name="line.211"></a>
-<span class="sourceLineNo">212</span>                    settingsDecrypter,<a name="line.212"></a>
-<span class="sourceLineNo">213</span>                    username,<a name="line.213"></a>
-<span class="sourceLineNo">214</span>                    password<a name="line.214"></a>
-<span class="sourceLineNo">215</span>            );<a name="line.215"></a>
-<span class="sourceLineNo">216</span>            distVersionRcVersionDirectory =<a name="line.216"></a>
-<span class="sourceLineNo">217</span>                    new File(distCheckoutDirectory, commonsReleaseVersion + "-" + commonsRcVersion);<a name="line.217"></a>
-<span class="sourceLineNo">218</span>            if (!distCheckoutDirectory.exists()) {<a name="line.218"></a>
-<span class="sourceLineNo">219</span>                SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);<a name="line.219"></a>
-<span class="sourceLineNo">220</span>            }<a name="line.220"></a>
-<span class="sourceLineNo">221</span>            ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);<a name="line.221"></a>
-<span class="sourceLineNo">222</span>            getLog().info("Checking out dist from: " + distSvnStagingUrl);<a name="line.222"></a>
-<span class="sourceLineNo">223</span>            final CheckOutScmResult checkOutResult = provider.checkOut(repository, scmFileSet);<a name="line.223"></a>
-<span class="sourceLineNo">224</span>            if (!checkOutResult.isSuccess()) {<a name="line.224"></a>
-<span class="sourceLineNo">225</span>                throw new MojoExecutionException("Failed to checkout files from SCM: "<a name="line.225"></a>
-<span class="sourceLineNo">226</span>                        + checkOutResult.getProviderMessage() + " [" + checkOutResult.getCommandOutput() + "]");<a name="line.226"></a>
-<span class="sourceLineNo">227</span>            }<a name="line.227"></a>
-<span class="sourceLineNo">228</span>            File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();<a name="line.228"></a>
-<span class="sourceLineNo">229</span>            copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,<a name="line.229"></a>
-<span class="sourceLineNo">230</span>                    provider, repository);<a name="line.230"></a>
-<span class="sourceLineNo">231</span>            List&lt;File&gt; filesToAdd = new ArrayList&lt;&gt;();<a name="line.231"></a>
-<span class="sourceLineNo">232</span>            listNotHiddenFilesAndDirectories(distCheckoutDirectory, filesToAdd);<a name="line.232"></a>
-<span class="sourceLineNo">233</span>            if (!dryRun) {<a name="line.233"></a>
-<span class="sourceLineNo">234</span>                ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);<a name="line.234"></a>
-<span class="sourceLineNo">235</span>                AddScmResult addResult = provider.add(<a name="line.235"></a>
-<span class="sourceLineNo">236</span>                        repository,<a name="line.236"></a>
-<span class="sourceLineNo">237</span>                        fileSet<a name="line.237"></a>
-<span class="sourceLineNo">238</span>                );<a name="line.238"></a>
-<span class="sourceLineNo">239</span>                if (!addResult.isSuccess()) {<a name="line.239"></a>
-<span class="sourceLineNo">240</span>                    throw new MojoExecutionException("Failed to add files to SCM: " + addResult.getProviderMessage()<a name="line.240"></a>
-<span class="sourceLineNo">241</span>                            + " [" + addResult.getCommandOutput() + "]");<a name="line.241"></a>
-<span class="sourceLineNo">242</span>                }<a name="line.242"></a>
-<span class="sourceLineNo">243</span>                getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());<a name="line.243"></a>
-<span class="sourceLineNo">244</span>                CheckInScmResult checkInResult = provider.checkIn(<a name="line.244"></a>
-<span class="sourceLineNo">245</span>                        repository,<a name="line.245"></a>
-<span class="sourceLineNo">246</span>                        fileSet,<a name="line.246"></a>
-<span class="sourceLineNo">247</span>                        "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()<a name="line.247"></a>
-<span class="sourceLineNo">248</span>                );<a name="line.248"></a>
-<span class="sourceLineNo">249</span>                if (!checkInResult.isSuccess()) {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>                    getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());<a name="line.250"></a>
-<span class="sourceLineNo">251</span>                    throw new MojoExecutionException(<a name="line.251"></a>
-<span class="sourceLineNo">252</span>                            "Committing dist files failed: " + checkInResult.getCommandOutput()<a name="line.252"></a>
-<span class="sourceLineNo">253</span>                    );<a name="line.253"></a>
-<span class="sourceLineNo">254</span>                }<a name="line.254"></a>
-<span class="sourceLineNo">255</span>                getLog().info("Committed revision " + checkInResult.getScmRevision());<a name="line.255"></a>
-<span class="sourceLineNo">256</span>            } else {<a name="line.256"></a>
-<span class="sourceLineNo">257</span>                getLog().info("[Dry run] Would have committed to: " + distSvnStagingUrl);<a name="line.257"></a>
-<span class="sourceLineNo">258</span>                getLog().info(<a name="line.258"></a>
-<span class="sourceLineNo">259</span>                        "[Dry run] Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());<a name="line.259"></a>
-<span class="sourceLineNo">260</span>            }<a name="line.260"></a>
-<span class="sourceLineNo">261</span>        } catch (ScmException e) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>            getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);<a name="line.262"></a>
-<span class="sourceLineNo">263</span>            throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);<a name="line.263"></a>
-<span class="sourceLineNo">264</span>        }<a name="line.264"></a>
-<span class="sourceLineNo">265</span>    }<a name="line.265"></a>
-<span class="sourceLineNo">266</span><a name="line.266"></a>
-<span class="sourceLineNo">267</span>    /**<a name="line.267"></a>
-<span class="sourceLineNo">268</span>     * Lists all directories and files to a flat list.<a name="line.268"></a>
-<span class="sourceLineNo">269</span>     * @param directory {@link File} containing directory to list<a name="line.269"></a>
-<span class="sourceLineNo">270</span>     * @param files a {@link List} of {@link File} to which to append the files.<a name="line.270"></a>
-<span class="sourceLineNo">271</span>     */<a name="line.271"></a>
-<span class="sourceLineNo">272</span>    private void listNotHiddenFilesAndDirectories(File directory, List&lt;File&gt; files) {<a name="line.272"></a>
-<span class="sourceLineNo">273</span>        // Get all the files and directories from a directory.<a name="line.273"></a>
-<span class="sourceLineNo">274</span>        File[] fList = directory.listFiles();<a name="line.274"></a>
-<span class="sourceLineNo">275</span>        for (File file : fList) {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>            if (file.isFile() &amp;&amp; !file.isHidden()) {<a name="line.276"></a>
-<span class="sourceLineNo">277</span>                files.add(file);<a name="line.277"></a>
-<span class="sourceLineNo">278</span>            } else if (file.isDirectory() &amp;&amp; !file.isHidden()) {<a name="line.278"></a>
-<span class="sourceLineNo">279</span>                files.add(file);<a name="line.279"></a>
-<span class="sourceLineNo">280</span>                listNotHiddenFilesAndDirectories(file, files);<a name="line.280"></a>
-<span class="sourceLineNo">281</span>            }<a name="line.281"></a>
-<span class="sourceLineNo">282</span>        }<a name="line.282"></a>
-<span class="sourceLineNo">283</span>    }<a name="line.283"></a>
-<span class="sourceLineNo">284</span><a name="line.284"></a>
-<span class="sourceLineNo">285</span>    /**<a name="line.285"></a>
-<span class="sourceLineNo">286</span>     * A utility method that takes the &lt;code&gt;RELEASE-NOTES.txt&lt;/code&gt; file from the base directory of the<a name="line.286"></a>
-<span class="sourceLineNo">287</span>     * project and copies it into {@link CommonsDistributionStagingMojo#workingDirectory}.<a name="line.287"></a>
-<span class="sourceLineNo">288</span>     *<a name="line.288"></a>
-<span class="sourceLineNo">289</span>     * @return the RELEASE-NOTES.txt file that exists in the &lt;code&gt;target/commons-release-notes/scm&lt;/code&gt;<a name="line.289"></a>
-<span class="sourceLineNo">290</span>     *         directory for the purpose of adding it to the scm change set in the method<a name="line.290"></a>
-<span class="sourceLineNo">291</span>     *         {@link CommonsDistributionStagingMojo#copyDistributionsIntoScmDirectoryStructureAndAddToSvn(File,<a name="line.291"></a>
-<span class="sourceLineNo">292</span>     *         ScmProvider, ScmRepository)}.<a name="line.292"></a>
-<span class="sourceLineNo">293</span>     * @throws MojoExecutionException if an {@link IOException} occurs as a wrapper so that maven<a name="line.293"></a>
-<span class="sourceLineNo">294</span>     *                                can properly handle the exception.<a name="line.294"></a>
-<span class="sourceLineNo">295</span>     */<a name="line.295"></a>
-<span class="sourceLineNo">296</span>    private File copyReleaseNotesToWorkingDirectory() throws MojoExecutionException {<a name="line.296"></a>
-<span class="sourceLineNo">297</span>        SharedFunctions.initDirectory(getLog(), distVersionRcVersionDirectory);<a name="line.297"></a>
-<span class="sourceLineNo">298</span>        getLog().info("Copying RELEASE-NOTES.txt to working directory.");<a name="line.298"></a>
-<span class="sourceLineNo">299</span>        File copiedReleaseNotes = new File(distVersionRcVersionDirectory, releaseNotesFile.getName());<a name="line.299"></a>
-<span class="sourceLineNo">300</span>        SharedFunctions.copyFile(getLog(), releaseNotesFile, copiedReleaseNotes);<a name="line.300"></a>
-<span class="sourceLineNo">301</span>        return copiedReleaseNotes;<a name="line.301"></a>
-<span class="sourceLineNo">302</span>    }<a name="line.302"></a>
-<span class="sourceLineNo">303</span><a name="line.303"></a>
-<span class="sourceLineNo">304</span>    /**<a name="line.304"></a>
-<span class="sourceLineNo">305</span>     * Copies the list of files at the root of the {@link CommonsDistributionStagingMojo#workingDirectory} into<a name="line.305"></a>
-<span class="sourceLineNo">306</span>     * the directory structure of the distribution staging repository. Specifically:<a name="line.306"></a>
-<span class="sourceLineNo">307</span>     * &lt;ul&gt;<a name="line.307"></a>
-<span class="sourceLineNo">308</span>     *   &lt;li&gt;root:<a name="line.308"></a>
-<span class="sourceLineNo">309</span>     *     &lt;ul&gt;<a name="line.309"></a>
-<span class="sourceLineNo">310</span>     *         &lt;li&gt;site&lt;/li&gt;<a name="line.310"></a>
-<span class="sourceLineNo">311</span>     *         &lt;li&gt;site.zip&lt;/li&gt;<a name="line.311"></a>
-<span class="sourceLineNo">312</span>     *         &lt;li&gt;RELEASE-NOTES.txt&lt;/li&gt;<a name="line.312"></a>
-<span class="sourceLineNo">313</span>     *         &lt;li&gt;source:<a name="line.313"></a>
-<span class="sourceLineNo">314</span>     *           &lt;ul&gt;<a name="line.314"></a>
-<span class="sourceLineNo">315</span>     *             &lt;li&gt;-src artifacts....&lt;/li&gt;<a name="line.315"></a>
-<span class="sourceLineNo">316</span>     *           &lt;/ul&gt;<a name="line.316"></a>
-<span class="sourceLineNo">317</span>     *         &lt;/li&gt;<a name="line.317"></a>
-<span class="sourceLineNo">318</span>     *         &lt;li&gt;binaries:<a name="line.318"></a>
-<span class="sourceLineNo">319</span>     *           &lt;ul&gt;<a name="line.319"></a>
-<span class="sourceLineNo">320</span>     *             &lt;li&gt;-bin artifacts....&lt;/li&gt;<a name="line.320"></a>
-<span class="sourceLineNo">321</span>     *           &lt;/ul&gt;<a name="line.321"></a>
-<span class="sourceLineNo">322</span>     *         &lt;/li&gt;<a name="line.322"></a>
-<span class="sourceLineNo">323</span>     *     &lt;/ul&gt;<a name="line.323"></a>
-<span class="sourceLineNo">324</span>     *   &lt;/li&gt;<a name="line.324"></a>
-<span class="sourceLineNo">325</span>     * &lt;/ul&gt;<a name="line.325"></a>
-<span class="sourceLineNo">326</span>     *<a name="line.326"></a>
-<span class="sourceLineNo">327</span>     * @param copiedReleaseNotes is the RELEASE-NOTES.txt file that exists in the<a name="line.327"></a>
-<span class="sourceLineNo">328</span>     *                           &lt;code&gt;target/commons-release-plugin/scm&lt;/code&gt; directory.<a name="line.328"></a>
-<span class="sourceLineNo">329</span>     * @param provider is the {@link ScmProvider} that we will use for adding the files we wish to commit.<a name="line.329"></a>
-<span class="sourceLineNo">330</span>     * @param repository is the {@link ScmRepository} that we will use for adding the files that we wish to commit.<a name="line.330"></a>
-<span class="sourceLineNo">331</span>     * @return a {@link List} of {@link File}'s in the directory for the purpose of adding them to the maven<a name="line.331"></a>
-<span class="sourceLineNo">332</span>     *         {@link ScmFileSet}.<a name="line.332"></a>
-<span class="sourceLineNo">333</span>     * @throws MojoExecutionException if an {@link IOException} occurs so that Maven can handle it properly.<a name="line.333"></a>
-<span class="sourceLineNo">334</span>     */<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    private List&lt;File&gt; copyDistributionsIntoScmDirectoryStructureAndAddToSvn(File copiedReleaseNotes,<a name="line.335"></a>
-<span class="sourceLineNo">336</span>                                                                             ScmProvider provider,<a name="line.336"></a>
-<span class="sourceLineNo">337</span>                                                                             ScmRepository repository)<a name="line.337"></a>
-<span class="sourceLineNo">338</span>            throws MojoExecutionException {<a name="line.338"></a>
-<span class="sourceLineNo">339</span>        List&lt;File&gt; workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());<a name="line.339"></a>
-<span class="sourceLineNo">340</span>        List&lt;File&gt; filesForMavenScmFileSet = new ArrayList&lt;&gt;();<a name="line.340"></a>
-<span class="sourceLineNo">341</span>        File scmBinariesRoot = new File(distVersionRcVersionDirectory, "binaries");<a name="line.341"></a>
-<span class="sourceLineNo">342</span>        File scmSourceRoot = new File(distVersionRcVersionDirectory, "source");<a name="line.342"></a>
-<span class="sourceLineNo">343</span>        SharedFunctions.initDirectory(getLog(), scmBinariesRoot);<a name="line.343"></a>
-<span class="sourceLineNo">344</span>        SharedFunctions.initDirectory(getLog(), scmSourceRoot);<a name="line.344"></a>
-<span class="sourceLineNo">345</span>        File copy;<a name="line.345"></a>
-<span class="sourceLineNo">346</span>        for (File file : workingDirectoryFiles) {<a name="line.346"></a>
-<span class="sourceLineNo">347</span>            if (file.getName().contains("src")) {<a name="line.347"></a>
-<span class="sourceLineNo">348</span>                copy = new File(scmSourceRoot,  file.getName());<a name="line.348"></a>
-<span class="sourceLineNo">349</span>                SharedFunctions.copyFile(getLog(), file, copy);<a name="line.349"></a>
-<span class="sourceLineNo">350</span>                filesForMavenScmFileSet.add(file);<a name="line.350"></a>
-<span class="sourceLineNo">351</span>            } else if (file.getName().contains("bin")) {<a name="line.351"></a>
-<span class="sourceLineNo">352</span>                copy = new File(scmBinariesRoot,  file.getName());<a name="line.352"></a>
-<span class="sourceLineNo">353</span>                SharedFunctions.copyFile(getLog(), file, copy);<a name="line.353"></a>
-<span class="sourceLineNo">354</span>                filesForMavenScmFileSet.add(file);<a name="line.354"></a>
-<span class="sourceLineNo">355</span>            } else if (StringUtils.containsAny(file.getName(), "scm", "sha256.properties", "sha512.properties")) {<a name="line.355"></a>
-<span class="sourceLineNo">356</span>                getLog().debug("Not copying scm directory over to the scm directory because it is the scm directory.");<a name="line.356"></a>
-<span class="sourceLineNo">357</span>                //do nothing because we are copying into scm<a name="line.357"></a>
-<span class="sourceLineNo">358</span>            } else {<a name="line.358"></a>
-<span class="sourceLineNo">359</span>                copy = new File(distCheckoutDirectory.getAbsolutePath(),  file.getName());<a name="line.359"></a>
-<span class="sourceLineNo">360</span>                SharedFunctions.copyFile(getLog(), file, copy);<a name="line.360"></a>
-<span class="sourceLineNo">361</span>                filesForMavenScmFileSet.add(file);<a name="line.361"></a>
-<span class="sourceLineNo">362</span>            }<a name="line.362"></a>
-<span class="sourceLineNo">363</span>        }<a name="line.363"></a>
-<span class="sourceLineNo">364</span>        filesForMavenScmFileSet.addAll(buildReadmeAndHeaderHtmlFiles());<a name="line.364"></a>
-<span class="sourceLineNo">365</span>        filesForMavenScmFileSet.addAll(copySiteToScmDirectory());<a name="line.365"></a>
-<span class="sourceLineNo">366</span>        return filesForMavenScmFileSet;<a name="line.366"></a>
-<span class="sourceLineNo">367</span>    }<a name="line.367"></a>
-<span class="sourceLineNo">368</span><a name="line.368"></a>
-<span class="sourceLineNo">369</span>    /**<a name="line.369"></a>
-<span class="sourceLineNo">370</span>     * Copies &lt;code&gt;${basedir}/target/site&lt;/code&gt; to &lt;code&gt;${basedir}/target/commons-release-plugin/scm/site&lt;/code&gt;.<a name="line.370"></a>
-<span class="sourceLineNo">371</span>     *<a name="line.371"></a>
-<span class="sourceLineNo">372</span>     * @return the {@link List} of {@link File}'s contained in<a name="line.372"></a>
-<span class="sourceLineNo">373</span>     *         &lt;code&gt;${basedir}/target/commons-release-plugin/scm/site&lt;/code&gt;, after the copy is complete.<a name="line.373"></a>
-<span class="sourceLineNo">374</span>     * @throws MojoExecutionException if the site copying fails for some reason.<a name="line.374"></a>
-<span class="sourceLineNo">375</span>     */<a name="line.375"></a>
-<span class="sourceLineNo">376</span>    private List&lt;File&gt; copySiteToScmDirectory() throws MojoExecutionException {<a name="line.376"></a>
-<span class="sourceLineNo">377</span>        if (!siteDirectory.exists()) {<a name="line.377"></a>
-<span class="sourceLineNo">378</span>            getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");<a name="line.378"></a>
-<span class="sourceLineNo">379</span>            throw new MojoExecutionException(<a name="line.379"></a>
-<span class="sourceLineNo">380</span>                    "\"mvn site\" was not run before this goal, or a siteDirectory did not exist."<a name="line.380"></a>
-<span class="sourceLineNo">381</span>            );<a name="line.381"></a>
-<span class="sourceLineNo">382</span>        }<a name="line.382"></a>
-<span class="sourceLineNo">383</span>        File siteInScm = new File(distVersionRcVersionDirectory, "site");<a name="line.383"></a>
-<span class="sourceLineNo">384</span>        try {<a name="line.384"></a>
-<span class="sourceLineNo">385</span>            FileUtils.copyDirectory(siteDirectory, siteInScm);<a name="line.385"></a>
-<span class="sourceLineNo">386</span>        } catch (IOException e) {<a name="line.386"></a>
-<span class="sourceLineNo">387</span>            throw new MojoExecutionException("Site copying failed", e);<a name="line.387"></a>
-<span class="sourceLineNo">388</span>        }<a name="line.388"></a>
-<span class="sourceLineNo">389</span>        return new ArrayList&lt;&gt;(FileUtils.listFiles(siteInScm, null, true));<a name="line.389"></a>
-<span class="sourceLineNo">390</span>    }<a name="line.390"></a>
-<span class="sourceLineNo">391</span><a name="line.391"></a>
-<span class="sourceLineNo">392</span>    /**<a name="line.392"></a>
-<span class="sourceLineNo">393</span>     * Builds up &lt;code&gt;README.html&lt;/code&gt; and &lt;code&gt;HEADER.html&lt;/code&gt; that reside in following.<a name="line.393"></a>
-<span class="sourceLineNo">394</span>     * &lt;ul&gt;<a name="line.394"></a>
-<span class="sourceLineNo">395</span>     *     &lt;li&gt;distRoot<a name="line.395"></a>
-<span class="sourceLineNo">396</span>     *     &lt;ul&gt;<a name="line.396"></a>
-<span class="sourceLineNo">397</span>     *         &lt;li&gt;binaries/HEADER.html (symlink)&lt;/li&gt;<a name="line.397"></a>
-<span class="sourceLineNo">398</span>     *         &lt;li&gt;binaries/README.html (symlink)&lt;/li&gt;<a name="line.398"></a>
-<span class="sourceLineNo">399</span>     *         &lt;li&gt;source/HEADER.html (symlink)&lt;/li&gt;<a name="line.399"></a>
-<span class="sourceLineNo">400</span>     *         &lt;li&gt;source/README.html (symlink)&lt;/li&gt;<a name="line.400"></a>
-<span class="sourceLineNo">401</span>     *         &lt;li&gt;HEADER.html&lt;/li&gt;<a name="line.401"></a>
-<span class="sourceLineNo">402</span>     *         &lt;li&gt;README.html&lt;/li&gt;<a name="line.402"></a>
-<span class="sourceLineNo">403</span>     *     &lt;/ul&gt;<a name="line.403"></a>
-<span class="sourceLineNo">404</span>     *     &lt;/li&gt;<a name="line.404"></a>
-<span class="sourceLineNo">405</span>     * &lt;/ul&gt;<a name="line.405"></a>
-<span class="sourceLineNo">406</span>     * @return the {@link List} of created files above<a name="line.406"></a>
-<span class="sourceLineNo">407</span>     * @throws MojoExecutionException if an {@link IOException} occurs in the creation of these<a name="line.407"></a>
-<span class="sourceLineNo">408</span>     *                                files fails.<a name="line.408"></a>
-<span class="sourceLineNo">409</span>     */<a name="line.409"></a>
-<span class="sourceLineNo">410</span>    private List&lt;File&gt; buildReadmeAndHeaderHtmlFiles() throws MojoExecutionException {<a name="line.410"></a>
-<span class="sourceLineNo">411</span>        List&lt;File&gt; headerAndReadmeFiles = new ArrayList&lt;&gt;();<a name="line.411"></a>
-<span class="sourceLineNo">412</span>        File headerFile = new File(distVersionRcVersionDirectory, HEADER_FILE_NAME);<a name="line.412"></a>
-<span class="sourceLineNo">413</span>        //<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        // HEADER file<a name="line.414"></a>
-<span class="sourceLineNo">415</span>        //<a name="line.415"></a>
-<span class="sourceLineNo">416</span>        try (Writer headerWriter = new OutputStreamWriter(new FileOutputStream(headerFile), "UTF-8")) {<a name="line.416"></a>
-<span class="sourceLineNo">417</span>            HeaderHtmlVelocityDelegate.builder().build().render(headerWriter);<a name="line.417"></a>
-<span class="sourceLineNo">418</span>        } catch (IOException e) {<a name="line.418"></a>
-<span class="sourceLineNo">419</span>            final String message = "Could not build HEADER html file " + headerFile;<a name="line.419"></a>
-<span class="sourceLineNo">420</span>            getLog().error(message, e);<a name="line.420"></a>
-<span class="sourceLineNo">421</span>            throw new MojoExecutionException(message, e);<a name="line.421"></a>
-<span class="sourceLineNo">422</span>        }<a name="line.422"></a>
-<span class="sourceLineNo">423</span>        headerAndReadmeFiles.add(headerFile);<a name="line.423"></a>
-<span class="sourceLineNo">424</span>        //<a name="line.424"></a>
-<span class="sourceLineNo">425</span>        // README file<a name="line.425"></a>
-<span class="sourceLineNo">426</span>        //<a name="line.426"></a>
-<span class="sourceLineNo">427</span>        File readmeFile = new File(distVersionRcVersionDirectory, README_FILE_NAME);<a name="line.427"></a>
-<span class="sourceLineNo">428</span>        try (Writer readmeWriter = new OutputStreamWriter(new FileOutputStream(readmeFile), "UTF-8")) {<a name="line.428"></a>
-<span class="sourceLineNo">429</span>            // @formatter:off<a name="line.429"></a>
-<span class="sourceLineNo">430</span>            ReadmeHtmlVelocityDelegate readmeHtmlVelocityDelegate = ReadmeHtmlVelocityDelegate.builder()<a name="line.430"></a>
-<span class="sourceLineNo">431</span>                    .withArtifactId(project.getArtifactId())<a name="line.431"></a>
-<span class="sourceLineNo">432</span>                    .withVersion(project.getVersion())<a name="line.432"></a>
-<span class="sourceLineNo">433</span>                    .withSiteUrl(project.getUrl())<a name="line.433"></a>
-<span class="sourceLineNo">434</span>                    .build();<a name="line.434"></a>
-<span class="sourceLineNo">435</span>            // @formatter:on<a name="line.435"></a>
-<span class="sourceLineNo">436</span>            readmeHtmlVelocityDelegate.render(readmeWriter);<a name="line.436"></a>
-<span class="sourceLineNo">437</span>        } catch (IOException e) {<a name="line.437"></a>
-<span class="sourceLineNo">438</span>            final String message = "Could not build README html file " + readmeFile;<a name="line.438"></a>
-<span class="sourceLineNo">439</span>            getLog().error(message, e);<a name="line.439"></a>
-<span class="sourceLineNo">440</span>            throw new MojoExecutionException(message, e);<a name="line.440"></a>
-<span class="sourceLineNo">441</span>        }<a name="line.441"></a>
-<span class="sourceLineNo">442</span>        headerAndReadmeFiles.add(readmeFile);<a name="line.442"></a>
-<span class="sourceLineNo">443</span>        headerAndReadmeFiles.addAll(copyHeaderAndReadmeToSubdirectories(headerFile, readmeFile));<a name="line.443"></a>
-<span class="sourceLineNo">444</span>        return headerAndReadmeFiles;<a name="line.444"></a>
-<span class="sourceLineNo">445</span>    }<a name="line.445"></a>
-<span class="sourceLineNo">446</span><a name="line.446"></a>
-<span class="sourceLineNo">447</span>    /**<a name="line.447"></a>
-<span class="sourceLineNo">448</span>     * Copies &lt;code&gt;README.html&lt;/code&gt; and &lt;code&gt;HEADER.html&lt;/code&gt; to the source and binaries<a name="line.448"></a>
-<span class="sourceLineNo">449</span>     * directories.<a name="line.449"></a>
-<span class="sourceLineNo">450</span>     *<a name="line.450"></a>
-<span class="sourceLineNo">451</span>     * @param headerFile The originally created &lt;code&gt;HEADER.html&lt;/code&gt; file.<a name="line.451"></a>
-<span class="sourceLineNo">452</span>     * @param readmeFile The originally created &lt;code&gt;README.html&lt;/code&gt; file.<a name="line.452"></a>
-<span class="sourceLineNo">453</span>     * @return a {@link List} of created files.<a name="line.453"></a>
-<span class="sourceLineNo">454</span>     * @throws MojoExecutionException if the {@link SharedFunctions#copyFile(Log, File, File)}<a name="line.454"></a>
-<span class="sourceLineNo">455</span>     *                                fails.<a name="line.455"></a>
-<span class="sourceLineNo">456</span>     */<a name="line.456"></a>
-<span class="sourceLineNo">457</span>    private List&lt;File&gt; copyHeaderAndReadmeToSubdirectories(File headerFile, File readmeFile)<a name="line.457"></a>
-<span class="sourceLineNo">458</span>            throws MojoExecutionException {<a name="line.458"></a>
-<span class="sourceLineNo">459</span>        List&lt;File&gt; symbolicLinkFiles = new ArrayList&lt;&gt;();<a name="line.459"></a>
-<span class="sourceLineNo">460</span>        File sourceRoot = new File(distVersionRcVersionDirectory, "source");<a name="line.460"></a>
-<span class="sourceLineNo">461</span>        File binariesRoot = new File(distVersionRcVersionDirectory, "binaries");<a name="line.461"></a>
-<span class="sourceLineNo">462</span>        File sourceHeaderFile = new File(sourceRoot, HEADER_FILE_NAME);<a name="line.462"></a>
-<span class="sourceLineNo">463</span>        File sourceReadmeFile = new File(sourceRoot, README_FILE_NAME);<a name="line.463"></a>
-<span class="sourceLineNo">464</span>        File binariesHeaderFile = new File(binariesRoot, HEADER_FILE_NAME);<a name="line.464"></a>
-<span class="sourceLineNo">465</span>        File binariesReadmeFile = new File(binariesRoot, README_FILE_NAME);<a name="line.465"></a>
-<span class="sourceLineNo">466</span>        SharedFunctions.copyFile(getLog(), headerFile, sourceHeaderFile);<a name="line.466"></a>
-<span class="sourceLineNo">467</span>        symbolicLinkFiles.add(sourceHeaderFile);<a name="line.467"></a>
-<span class="sourceLineNo">468</span>        SharedFunctions.copyFile(getLog(), readmeFile, sourceReadmeFile);<a name="line.468"></a>
-<span class="sourceLineNo">469</span>        symbolicLinkFiles.add(sourceReadmeFile);<a name="line.469"></a>
-<span class="sourceLineNo">470</span>        SharedFunctions.copyFile(getLog(), headerFile, binariesHeaderFile);<a name="line.470"></a>
-<span class="sourceLineNo">471</span>        symbolicLinkFiles.add(binariesHeaderFile);<a name="line.471"></a>
-<span class="sourceLineNo">472</span>        SharedFunctions.copyFile(getLog(), readmeFile, binariesReadmeFile);<a name="line.472"></a>
-<span class="sourceLineNo">473</span>        symbolicLinkFiles.add(binariesReadmeFile);<a name="line.473"></a>
-<span class="sourceLineNo">474</span>        return symbolicLinkFiles;<a name="line.474"></a>
-<span class="sourceLineNo">475</span>    }<a name="line.475"></a>
-<span class="sourceLineNo">476</span><a name="line.476"></a>
-<span class="sourceLineNo">477</span>    /**<a name="line.477"></a>
-<span class="sourceLineNo">478</span>     * This method is the setter for the {@link CommonsDistributionStagingMojo#baseDir} field, specifically<a name="line.478"></a>
-<span class="sourceLineNo">479</span>     * for the usage in the unit tests.<a name="line.479"></a>
-<span class="sourceLineNo">480</span>     *<a name="line.480"></a>
-<span class="sourceLineNo">481</span>     * @param baseDir is the {@link File} to be used as the project's root directory when this mojo<a name="line.481"></a>
-<span class="sourceLineNo">482</span>     *                is invoked.<a name="line.482"></a>
-<span class="sourceLineNo">483</span>     */<a name="line.483"></a>
-<span class="sourceLineNo">484</span>    protected void setBaseDir(File baseDir) {<a name="line.484"></a>
-<span class="sourceLineNo">485</span>        this.baseDir = baseDir;<a name="line.485"></a>
-<span class="sourceLineNo">486</span>    }<a name="line.486"></a>
-<span class="sourceLineNo">487</span>}<a name="line.487"></a>
+<span class="sourceLineNo">205</span>            final ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);<a name="line.205"></a>
+<span class="sourceLineNo">206</span>            final ScmProvider provider = scmManager.getProviderByRepository(repository);<a name="line.206"></a>
+<span class="sourceLineNo">207</span>            final SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository<a name="line.207"></a>
+<span class="sourceLineNo">208</span>                    .getProviderRepository();<a name="line.208"></a>
+<span class="sourceLineNo">209</span>            SharedFunctions.setAuthentication(<a name="line.209"></a>
+<span class="sourceLineNo">210</span>                    providerRepository,<a name="line.210"></a>
+<span class="sourceLineNo">211</span>                    distServer,<a name="line.211"></a>
+<span class="sourceLineNo">212</span>                    settings,<a name="line.212"></a>
+<span class="sourceLineNo">213</span>                    settingsDecrypter,<a name="line.213"></a>
+<span class="sourceLineNo">214</span>                    username,<a name="line.214"></a>
+<span class="sourceLineNo">215</span>                    password<a name="line.215"></a>
+<span class="sourceLineNo">216</span>            );<a name="line.216"></a>
+<span class="sourceLineNo">217</span>            distVersionRcVersionDirectory =<a name="line.217"></a>
+<span class="sourceLineNo">218</span>                    new File(distCheckoutDirectory, commonsReleaseVersion + "-" + commonsRcVersion);<a name="line.218"></a>
+<span class="sourceLineNo">219</span>            if (!distCheckoutDirectory.exists()) {<a name="line.219"></a>
+<span class="sourceLineNo">220</span>                SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);<a name="line.220"></a>
+<span class="sourceLineNo">221</span>            }<a name="line.221"></a>
+<span class="sourceLineNo">222</span>            final ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);<a name="line.222"></a>
+<span class="sourceLineNo">223</span>            getLog().info("Checking out dist from: " + distSvnStagingUrl);<a name="line.223"></a>
+<span class="sourceLineNo">224</span>            final CheckOutScmResult checkOutResult = provider.checkOut(repository, scmFileSet);<a name="line.224"></a>
+<span class="sourceLineNo">225</span>            if (!checkOutResult.isSuccess()) {<a name="line.225"></a>
+<span class="sourceLineNo">226</span>                throw new MojoExecutionException("Failed to checkout files from SCM: "<a name="line.226"></a>
+<span class="sourceLineNo">227</span>                        + checkOutResult.getProviderMessage() + " [" + checkOutResult.getCommandOutput() + "]");<a name="line.227"></a>
+<span class="sourceLineNo">228</span>            }<a name="line.228"></a>
+<span class="sourceLineNo">229</span>            final File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();<a name="line.229"></a>
+<span class="sourceLineNo">230</span>            copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,<a name="line.230"></a>
+<span class="sourceLineNo">231</span>                    provider, repository);<a name="line.231"></a>
+<span class="sourceLineNo">232</span>            final List&lt;File&gt; filesToAdd = new ArrayList&lt;&gt;();<a name="line.232"></a>
+<span class="sourceLineNo">233</span>            listNotHiddenFilesAndDirectories(distCheckoutDirectory, filesToAdd);<a name="line.233"></a>
+<span class="sourceLineNo">234</span>            if (!dryRun) {<a name="line.234"></a>
+<span class="sourceLineNo">235</span>                final ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);<a name="line.235"></a>
+<span class="sourceLineNo">236</span>                final AddScmResult addResult = provider.add(<a name="line.236"></a>
+<span class="sourceLineNo">237</span>                        repository,<a name="line.237"></a>
+<span class="sourceLineNo">238</span>                        fileSet<a name="line.238"></a>
+<span class="sourceLineNo">239</span>                );<a name="line.239"></a>
+<span class="sourceLineNo">240</span>                if (!addResult.isSuccess()) {<a name="line.240"></a>
+<span class="sourceLineNo">241</span>                    throw new MojoExecutionException("Failed to add files to SCM: " + addResult.getProviderMessage()<a name="line.241"></a>
+<span class="sourceLineNo">242</span>                            + " [" + addResult.getCommandOutput() + "]");<a name="line.242"></a>
+<span class="sourceLineNo">243</span>                }<a name="line.243"></a>
+<span class="sourceLineNo">244</span>                getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());<a name="line.244"></a>
+<span class="sourceLineNo">245</span>                final CheckInScmResult checkInResult = provider.checkIn(<a name="line.245"></a>
+<span class="sourceLineNo">246</span>                        repository,<a name="line.246"></a>
+<span class="sourceLineNo">247</span>                        fileSet,<a name="line.247"></a>
+<span class="sourceLineNo">248</span>                        "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()<a name="line.248"></a>
+<span class="sourceLineNo">249</span>                );<a name="line.249"></a>
+<span class="sourceLineNo">250</span>                if (!checkInResult.isSuccess()) {<a name="line.250"></a>
+<span class="sourceLineNo">251</span>                    getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());<a name="line.251"></a>
+<span class="sourceLineNo">252</span>                    throw new MojoExecutionException(<a name="line.252"></a>
+<span class="sourceLineNo">253</span>                            "Committing dist files failed: " + checkInResult.getCommandOutput()<a name="line.253"></a>
+<span class="sourceLineNo">254</span>                    );<a name="line.254"></a>
+<span class="sourceLineNo">255</span>                }<a name="line.255"></a>
+<span class="sourceLineNo">256</span>                getLog().info("Committed revision " + checkInResult.getScmRevision());<a name="line.256"></a>
+<span class="sourceLineNo">257</span>            } else {<a name="line.257"></a>
+<span class="sourceLineNo">258</span>                getLog().info("[Dry run] Would have committed to: " + distSvnStagingUrl);<a name="line.258"></a>
+<span class="sourceLineNo">259</span>                getLog().info(<a name="line.259"></a>
+<span class="sourceLineNo">260</span>                        "[Dry run] Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());<a name="line.260"></a>
+<span class="sourceLineNo">261</span>            }<a name="line.261"></a>
+<span class="sourceLineNo">262</span>        } catch (final ScmException e) {<a name="line.262"></a>
+<span class="sourceLineNo">263</span>            getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);<a name="line.263"></a>
+<span class="sourceLineNo">264</span>            throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);<a name="line.264"></a>
+<span class="sourceLineNo">265</span>        }<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    }<a name="line.266"></a>
+<span class="sourceLineNo">267</span><a name="line.267"></a>
+<span class="sourceLineNo">268</span>    /**<a name="line.268"></a>
+<span class="sourceLineNo">269</span>     * Lists all directories and files to a flat list.<a name="line.269"></a>
+<span class="sourceLineNo">270</span>     * @param directory {@link File} containing directory to list<a name="line.270"></a>
+<span class="sourceLineNo">271</span>     * @param files a {@link List} of {@link File} to which to append the files.<a name="line.271"></a>
+<span class="sourceLineNo">272</span>     */<a name="line.272"></a>
+<span class="sourceLineNo">273</span>    private void listNotHiddenFilesAndDirectories(final File directory, final List&lt;File&gt; files) {<a name="line.273"></a>
+<span class="sourceLineNo">274</span>        // Get all the files and directories from a directory.<a name="line.274"></a>
+<span class="sourceLineNo">275</span>        final File[] fList = directory.listFiles();<a name="line.275"></a>
+<span class="sourceLineNo">276</span>        for (final File file : fList) {<a name="line.276"></a>
+<span class="sourceLineNo">277</span>            if (file.isFile() &amp;&amp; !file.isHidden()) {<a name="line.277"></a>
+<span class="sourceLineNo">278</span>                files.add(file);<a name="line.278"></a>
+<span class="sourceLineNo">279</span>            } else if (file.isDirectory() &amp;&amp; !file.isHidden()) {<a name="line.279"></a>
+<span class="sourceLineNo">280</span>                files.add(file);<a name="line.280"></a>
+<span class="sourceLineNo">281</span>                listNotHiddenFilesAndDirectories(file, files);<a name="line.281"></a>
+<span class="sourceLineNo">282</span>            }<a name="line.282"></a>
+<span class="sourceLineNo">283</span>        }<a name="line.283"></a>
+<span class="sourceLineNo">284</span>    }<a name="line.284"></a>
+<span class="sourceLineNo">285</span><a name="line.285"></a>
+<span class="sourceLineNo">286</span>    /**<a name="line.286"></a>
+<span class="sourceLineNo">287</span>     * A utility method that takes the &lt;code&gt;RELEASE-NOTES.txt&lt;/code&gt; file from the base directory of the<a name="line.287"></a>
+<span class="sourceLineNo">288</span>     * project and copies it into {@link CommonsDistributionStagingMojo#workingDirectory}.<a name="line.288"></a>
+<span class="sourceLineNo">289</span>     *<a name="line.289"></a>
+<span class="sourceLineNo">290</span>     * @return the RELEASE-NOTES.txt file that exists in the &lt;code&gt;target/commons-release-notes/scm&lt;/code&gt;<a name="line.290"></a>
+<span class="sourceLineNo">291</span>     *         directory for the purpose of adding it to the scm change set in the method<a name="line.291"></a>
+<span class="sourceLineNo">292</span>     *         {@link CommonsDistributionStagingMojo#copyDistributionsIntoScmDirectoryStructureAndAddToSvn(File,<a name="line.292"></a>
+<span class="sourceLineNo">293</span>     *         ScmProvider, ScmRepository)}.<a name="line.293"></a>
+<span class="sourceLineNo">294</span>     * @throws MojoExecutionException if an {@link IOException} occurs as a wrapper so that maven<a name="line.294"></a>
+<span class="sourceLineNo">295</span>     *                                can properly handle the exception.<a name="line.295"></a>
+<span class="sourceLineNo">296</span>     */<a name="line.296"></a>
+<span class="sourceLineNo">297</span>    private File copyReleaseNotesToWorkingDirectory() throws MojoExecutionException {<a name="line.297"></a>
+<span class="sourceLineNo">298</span>        SharedFunctions.initDirectory(getLog(), distVersionRcVersionDirectory);<a name="line.298"></a>
+<span class="sourceLineNo">299</span>        getLog().info("Copying RELEASE-NOTES.txt to working directory.");<a name="line.299"></a>
+<span class="sourceLineNo">300</span>        final File copiedReleaseNotes = new File(distVersionRcVersionDirectory, releaseNotesFile.getName());<a name="line.300"></a>
+<span class="sourceLineNo">301</span>        SharedFunctions.copyFile(getLog(), releaseNotesFile, copiedReleaseNotes);<a name="line.301"></a>
+<span class="sourceLineNo">302</span>        return copiedReleaseNotes;<a name="line.302"></a>
+<span class="sourceLineNo">303</span>    }<a name="line.303"></a>
+<span class="sourceLineNo">304</span><a name="line.304"></a>
+<span class="sourceLineNo">305</span>    /**<a name="line.305"></a>
+<span class="sourceLineNo">306</span>     * Copies the list of files at the root of the {@link CommonsDistributionStagingMojo#workingDirectory} into<a name="line.306"></a>
+<span class="sourceLineNo">307</span>     * the directory structure of the distribution staging repository. Specifically:<a name="line.307"></a>
+<span class="sourceLineNo">308</span>     * &lt;ul&gt;<a name="line.308"></a>
+<span class="sourceLineNo">309</span>     *   &lt;li&gt;root:<a name="line.309"></a>
+<span class="sourceLineNo">310</span>     *     &lt;ul&gt;<a name="line.310"></a>
+<span class="sourceLineNo">311</span>     *         &lt;li&gt;site&lt;/li&gt;<a name="line.311"></a>
+<span class="sourceLineNo">312</span>     *         &lt;li&gt;site.zip&lt;/li&gt;<a name="line.312"></a>
+<span class="sourceLineNo">313</span>     *         &lt;li&gt;RELEASE-NOTES.txt&lt;/li&gt;<a name="line.313"></a>
+<span class="sourceLineNo">314</span>     *         &lt;li&gt;source:<a name="line.314"></a>
+<span class="sourceLineNo">315</span>     *           &lt;ul&gt;<a name="line.315"></a>
+<span class="sourceLineNo">316</span>     *             &lt;li&gt;-src artifacts....&lt;/li&gt;<a name="line.316"></a>
+<span class="sourceLineNo">317</span>     *           &lt;/ul&gt;<a name="line.317"></a>
+<span class="sourceLineNo">318</span>     *         &lt;/li&gt;<a name="line.318"></a>
+<span class="sourceLineNo">319</span>     *         &lt;li&gt;binaries:<a name="line.319"></a>
+<span class="sourceLineNo">320</span>     *           &lt;ul&gt;<a name="line.320"></a>
+<span class="sourceLineNo">321</span>     *             &lt;li&gt;-bin artifacts....&lt;/li&gt;<a name="line.321"></a>
+<span class="sourceLineNo">322</span>     *           &lt;/ul&gt;<a name="line.322"></a>
+<span class="sourceLineNo">323</span>     *         &lt;/li&gt;<a name="line.323"></a>
+<span class="sourceLineNo">324</span>     *     &lt;/ul&gt;<a name="line.324"></a>
+<span class="sourceLineNo">325</span>     *   &lt;/li&gt;<a name="line.325"></a>
+<span class="sourceLineNo">326</span>     * &lt;/ul&gt;<a name="line.326"></a>
+<span class="sourceLineNo">327</span>     *<a name="line.327"></a>
+<span class="sourceLineNo">328</span>     * @param copiedReleaseNotes is the RELEASE-NOTES.txt file that exists in the<a name="line.328"></a>
+<span class="sourceLineNo">329</span>     *                           &lt;code&gt;target/commons-release-plugin/scm&lt;/code&gt; directory.<a name="line.329"></a>
+<span class="sourceLineNo">330</span>     * @param provider is the {@link ScmProvider} that we will use for adding the files we wish to commit.<a name="line.330"></a>
+<span class="sourceLineNo">331</span>     * @param repository is the {@link ScmRepository} that we will use for adding the files that we wish to commit.<a name="line.331"></a>
+<span class="sourceLineNo">332</span>     * @return a {@link List} of {@link File}'s in the directory for the purpose of adding them to the maven<a name="line.332"></a>
+<span class="sourceLineNo">333</span>     *         {@link ScmFileSet}.<a name="line.333"></a>
+<span class="sourceLineNo">334</span>     * @throws MojoExecutionException if an {@link IOException} occurs so that Maven can handle it properly.<a name="line.334"></a>
+<span class="sourceLineNo">335</span>     */<a name="line.335"></a>
+<span class="sourceLineNo">336</span>    private List&lt;File&gt; copyDistributionsIntoScmDirectoryStructureAndAddToSvn(final File copiedReleaseNotes,<a name="line.336"></a>
+<span class="sourceLineNo">337</span>                                                                             final ScmProvider provider,<a name="line.337"></a>
+<span class="sourceLineNo">338</span>                                                                             final ScmRepository repository)<a name="line.338"></a>
+<span class="sourceLineNo">339</span>            throws MojoExecutionException {<a name="line.339"></a>
+<span class="sourceLineNo">340</span>        final List&lt;File&gt; workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());<a name="line.340"></a>
+<span class="sourceLineNo">341</span>        final List&lt;File&gt; filesForMavenScmFileSet = new ArrayList&lt;&gt;();<a name="line.341"></a>
+<span class="sourceLineNo">342</span>        final File scmBinariesRoot = new File(distVersionRcVersionDirectory, "binaries");<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        final File scmSourceRoot = new File(distVersionRcVersionDirectory, "source");<a name="line.343"></a>
+<span class="sourceLineNo">344</span>        SharedFunctions.initDirectory(getLog(), scmBinariesRoot);<a name="line.344"></a>
+<span class="sourceLineNo">345</span>        SharedFunctions.initDirectory(getLog(), scmSourceRoot);<a name="line.345"></a>
+<span class="sourceLineNo">346</span>        File copy;<a name="line.346"></a>
+<span class="sourceLineNo">347</span>        for (final File file : workingDirectoryFiles) {<a name="line.347"></a>
+<span class="sourceLineNo">348</span>            if (file.getName().contains("src")) {<a name="line.348"></a>
+<span class="sourceLineNo">349</span>                copy = new File(scmSourceRoot,  file.getName());<a name="line.349"></a>
+<span class="sourceLineNo">350</span>                SharedFunctions.copyFile(getLog(), file, copy);<a name="line.350"></a>
+<span class="sourceLineNo">351</span>                filesForMavenScmFileSet.add(file);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>            } else if (file.getName().contains("bin")) {<a name="line.352"></a>
+<span class="sourceLineNo">353</span>                copy = new File(scmBinariesRoot,  file.getName());<a name="line.353"></a>
+<span class="sourceLineNo">354</span>                SharedFunctions.copyFile(getLog(), file, copy);<a name="line.354"></a>
+<span class="sourceLineNo">355</span>                filesForMavenScmFileSet.add(file);<a name="line.355"></a>
+<span class="sourceLineNo">356</span>            } else if (StringUtils.containsAny(file.getName(), "scm", "sha256.properties", "sha512.properties")) {<a name="line.356"></a>
+<span class="sourceLineNo">357</span>                getLog().debug("Not copying scm directory over to the scm directory because it is the scm directory.");<a name="line.357"></a>
+<span class="sourceLineNo">358</span>                //do nothing because we are copying into scm<a name="line.358"></a>
+<span class="sourceLineNo">359</span>            } else {<a name="line.359"></a>
+<span class="sourceLineNo">360</span>                copy = new File(distCheckoutDirectory.getAbsolutePath(),  file.getName());<a name="line.360"></a>
+<span class="sourceLineNo">361</span>                SharedFunctions.copyFile(getLog(), file, copy);<a name="line.361"></a>
+<span class="sourceLineNo">362</span>                filesForMavenScmFileSet.add(file);<a name="line.362"></a>
+<span class="sourceLineNo">363</span>            }<a name="line.363"></a>
+<span class="sourceLineNo">364</span>        }<a name="line.364"></a>
+<span class="sourceLineNo">365</span>        filesForMavenScmFileSet.addAll(buildReadmeAndHeaderHtmlFiles());<a name="line.365"></a>
+<span class="sourceLineNo">366</span>        filesForMavenScmFileSet.addAll(copySiteToScmDirectory());<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        return filesForMavenScmFileSet;<a name="line.367"></a>
+<span class="sourceLineNo">368</span>    }<a name="line.368"></a>
+<span class="sourceLineNo">369</span><a name="line.369"></a>
+<span class="sourceLineNo">370</span>    /**<a name="line.370"></a>
+<span class="sourceLineNo">371</span>     * Copies &lt;code&gt;${basedir}/target/site&lt;/code&gt; to &lt;code&gt;${basedir}/target/commons-release-plugin/scm/site&lt;/code&gt;.<a name="line.371"></a>
+<span class="sourceLineNo">372</span>     *<a name="line.372"></a>
+<span class="sourceLineNo">373</span>     * @return the {@link List} of {@link File}'s contained in<a name="line.373"></a>
+<span class="sourceLineNo">374</span>     *         &lt;code&gt;${basedir}/target/commons-release-plugin/scm/site&lt;/code&gt;, after the copy is complete.<a name="line.374"></a>
+<span class="sourceLineNo">375</span>     * @throws MojoExecutionException if the site copying fails for some reason.<a name="line.375"></a>
+<span class="sourceLineNo">376</span>     */<a name="line.376"></a>
+<span class="sourceLineNo">377</span>    private List&lt;File&gt; copySiteToScmDirectory() throws MojoExecutionException {<a name="line.377"></a>
+<span class="sourceLineNo">378</span>        if (!siteDirectory.exists()) {<a name="line.378"></a>
+<span class="sourceLineNo">379</span>            getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");<a name="line.379"></a>
+<span class="sourceLineNo">380</span>            throw new MojoExecutionException(<a name="line.380"></a>
+<span class="sourceLineNo">381</span>                    "\"mvn site\" was not run before this goal, or a siteDirectory did not exist."<a name="line.381"></a>
+<span class="sourceLineNo">382</span>            );<a name="line.382"></a>
+<span class="sourceLineNo">383</span>        }<a name="line.383"></a>
+<span class="sourceLineNo">384</span>        final File siteInScm = new File(distVersionRcVersionDirectory, "site");<a name="line.384"></a>
+<span class="sourceLineNo">385</span>        try {<a name="line.385"></a>
+<span class="sourceLineNo">386</span>            FileUtils.copyDirectory(siteDirectory, siteInScm);<a name="line.386"></a>
+<span class="sourceLineNo">387</span>        } catch (final IOException e) {<a name="line.387"></a>
+<span class="sourceLineNo">388</span>            throw new MojoExecutionException("Site copying failed", e);<a name="line.388"></a>
+<span class="sourceLineNo">389</span>        }<a name="line.389"></a>
+<span class="sourceLineNo">390</span>        return new ArrayList&lt;&gt;(FileUtils.listFiles(siteInScm, null, true));<a name="line.390"></a>
+<span class="sourceLineNo">391</span>    }<a name="line.391"></a>
+<span class="sourceLineNo">392</span><a name="line.392"></a>
+<span class="sourceLineNo">393</span>    /**<a name="line.393"></a>
+<span class="sourceLineNo">394</span>     * Builds up &lt;code&gt;README.html&lt;/code&gt; and &lt;code&gt;HEADER.html&lt;/code&gt; that reside in following.<a name="line.394"></a>
+<span class="sourceLineNo">395</span>     * &lt;ul&gt;<a name="line.395"></a>
+<span class="sourceLineNo">396</span>     *     &lt;li&gt;distRoot<a name="line.396"></a>
+<span class="sourceLineNo">397</span>     *     &lt;ul&gt;<a name="line.397"></a>
+<span class="sourceLineNo">398</span>     *         &lt;li&gt;binaries/HEADER.html (symlink)&lt;/li&gt;<a name="line.398"></a>
+<span class="sourceLineNo">399</span>     *         &lt;li&gt;binaries/README.html (symlink)&lt;/li&gt;<a name="line.399"></a>
+<span class="sourceLineNo">400</span>     *         &lt;li&gt;source/HEADER.html (symlink)&lt;/li&gt;<a name="line.400"></a>
+<span class="sourceLineNo">401</span>     *         &lt;li&gt;source/README.html (symlink)&lt;/li&gt;<a name="line.401"></a>
+<span class="sourceLineNo">402</span>     *         &lt;li&gt;HEADER.html&lt;/li&gt;<a name="line.402"></a>
+<span class="sourceLineNo">403</span>     *         &lt;li&gt;README.html&lt;/li&gt;<a name="line.403"></a>
+<span class="sourceLineNo">404</span>     *     &lt;/ul&gt;<a name="line.404"></a>
+<span class="sourceLineNo">405</span>     *     &lt;/li&gt;<a name="line.405"></a>
+<span class="sourceLineNo">406</span>     * &lt;/ul&gt;<a name="line.406"></a>
+<span class="sourceLineNo">407</span>     * @return the {@link List} of created files above<a name="line.407"></a>
+<span class="sourceLineNo">408</span>     * @throws MojoExecutionException if an {@link IOException} occurs in the creation of these<a name="line.408"></a>
+<span class="sourceLineNo">409</span>     *                                files fails.<a name="line.409"></a>
+<span class="sourceLineNo">410</span>     */<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    private List&lt;File&gt; buildReadmeAndHeaderHtmlFiles() throws MojoExecutionException {<a name="line.411"></a>
+<span class="sourceLineNo">412</span>        final List&lt;File&gt; headerAndReadmeFiles = new ArrayList&lt;&gt;();<a name="line.412"></a>
+<span class="sourceLineNo">413</span>        final File headerFile = new File(distVersionRcVersionDirectory, HEADER_FILE_NAME);<a name="line.413"></a>
+<span class="sourceLineNo">414</span>        //<a name="line.414"></a>
+<span class="sourceLineNo">415</span>        // HEADER file<a name="line.415"></a>
+<span class="sourceLineNo">416</span>        //<a name="line.416"></a>
+<span class="sourceLineNo">417</span>        try (Writer headerWriter = new OutputStreamWriter(new FileOutputStream(headerFile), "UTF-8")) {<a name="line.417"></a>
+<span class="sourceLineNo">418</span>            HeaderHtmlVelocityDelegate.builder().build().render(headerWriter);<a name="line.418"></a>
+<span class="sourceLineNo">419</span>        } catch (final IOException e) {<a name="line.419"></a>
+<span class="sourceLineNo">420</span>            final String message = "Could not build HEADER html file " + headerFile;<a name="line.420"></a>
+<span class="sourceLineNo">421</span>            getLog().error(message, e);<a name="line.421"></a>
+<span class="sourceLineNo">422</span>            throw new MojoExecutionException(message, e);<a name="line.422"></a>
+<span class="sourceLineNo">423</span>        }<a name="line.423"></a>
+<span class="sourceLineNo">424</span>        headerAndReadmeFiles.add(headerFile);<a name="line.424"></a>
+<span class="sourceLineNo">425</span>        //<a name="line.425"></a>
+<span class="sourceLineNo">426</span>        // README file<a name="line.426"></a>
+<span class="sourceLineNo">427</span>        //<a name="line.427"></a>
+<span class="sourceLineNo">428</span>        final File readmeFile = new File(distVersionRcVersionDirectory, README_FILE_NAME);<a name="line.428"></a>
+<span class="sourceLineNo">429</span>        try (Writer readmeWriter = new OutputStreamWriter(new FileOutputStream(readmeFile), "UTF-8")) {<a name="line.429"></a>
+<span class="sourceLineNo">430</span>            // @formatter:off<a name="line.430"></a>
+<span class="sourceLineNo">431</span>            final ReadmeHtmlVelocityDelegate readmeHtmlVelocityDelegate = ReadmeHtmlVelocityDelegate.builder()<a name="line.431"></a>
+<span class="sourceLineNo">432</span>                    .withArtifactId(project.getArtifactId())<a name="line.432"></a>
+<span class="sourceLineNo">433</span>                    .withVersion(project.getVersion())<a name="line.433"></a>
+<span class="sourceLineNo">434</span>                    .withSiteUrl(project.getUrl())<a name="line.434"></a>
+<span class="sourceLineNo">435</span>                    .build();<a name="line.435"></a>
+<span class="sourceLineNo">436</span>            // @formatter:on<a name="line.436"></a>
+<span class="sourceLineNo">437</span>            readmeHtmlVelocityDelegate.render(readmeWriter);<a name="line.437"></a>
+<span class="sourceLineNo">438</span>        } catch (final IOException e) {<a name="line.438"></a>
+<span class="sourceLineNo">439</span>            final String message = "Could not build README html file " + readmeFile;<a name="line.439"></a>
+<span class="sourceLineNo">440</span>            getLog().error(message, e);<a name="line.440"></a>
+<span class="sourceLineNo">441</span>            throw new MojoExecutionException(message, e);<a name="line.441"></a>
+<span class="sourceLineNo">442</span>        }<a name="line.442"></a>
+<span class="sourceLineNo">443</span>        headerAndReadmeFiles.add(readmeFile);<a name="line.443"></a>
+<span class="sourceLineNo">444</span>        headerAndReadmeFiles.addAll(copyHeaderAndReadmeToSubdirectories(headerFile, readmeFile));<a name="line.444"></a>
+<span class="sourceLineNo">445</span>        return headerAndReadmeFiles;<a name="line.445"></a>
+<span class="sourceLineNo">446</span>    }<a name="line.446"></a>
+<span class="sourceLineNo">447</span><a name="line.447"></a>
+<span class="sourceLineNo">448</span>    /**<a name="line.448"></a>
+<span class="sourceLineNo">449</span>     * Copies &lt;code&gt;README.html&lt;/code&gt; and &lt;code&gt;HEADER.html&lt;/code&gt; to the source and binaries<a name="line.449"></a>
+<span class="sourceLineNo">450</span>     * directories.<a name="line.450"></a>
+<span class="sourceLineNo">451</span>     *<a name="line.451"></a>
+<span class="sourceLineNo">452</span>     * @param headerFile The originally created &lt;code&gt;HEADER.html&lt;/code&gt; file.<a name="line.452"></a>
+<span class="sourceLineNo">453</span>     * @param readmeFile The originally created &lt;code&gt;README.html&lt;/code&gt; file.<a name="line.453"></a>
+<span class="sourceLineNo">454</span>     * @return a {@link List} of created files.<a name="line.454"></a>
+<span class="sourceLineNo">455</span>     * @throws MojoExecutionException if the {@link SharedFunctions#copyFile(Log, File, File)}<a name="line.455"></a>
+<span class="sourceLineNo">456</span>     *                                fails.<a name="line.456"></a>
+<span class="sourceLineNo">457</span>     */<a name="line.457"></a>
+<span class="sourceLineNo">458</span>    private List&lt;File&gt; copyHeaderAndReadmeToSubdirectories(final File headerFile, final File readmeFile)<a name="line.458"></a>
+<span class="sourceLineNo">459</span>            throws MojoExecutionException {<a name="line.459"></a>
+<span class="sourceLineNo">460</span>        final List&lt;File&gt; symbolicLinkFiles = new ArrayList&lt;&gt;();<a name="line.460"></a>
+<span class="sourceLineNo">461</span>        final File sourceRoot = new File(distVersionRcVersionDirectory, "source");<a name="line.461"></a>
+<span class="sourceLineNo">462</span>        final File binariesRoot = new File(distVersionRcVersionDirectory, "binaries");<a name="line.462"></a>
+<span class="sourceLineNo">463</span>        final File sourceHeaderFile = new File(sourceRoot, HEADER_FILE_NAME);<a name="line.463"></a>
+<span class="sourceLineNo">464</span>        final File sourceReadmeFile = new File(sourceRoot, README_FILE_NAME);<a name="line.464"></a>
+<span class="sourceLineNo">465</span>        final File binariesHeaderFile = new File(binariesRoot, HEADER_FILE_NAME);<a name="line.465"></a>
+<span class="sourceLineNo">466</span>        final File binariesReadmeFile = new File(binariesRoot, README_FILE_NAME);<a name="line.466"></a>
+<span class="sourceLineNo">467</span>        SharedFunctions.copyFile(getLog(), headerFile, sourceHeaderFile);<a name="line.467"></a>
+<span class="sourceLineNo">468</span>        symbolicLinkFiles.add(sourceHeaderFile);<a name="line.468"></a>
+<span class="sourceLineNo">469</span>        SharedFunctions.copyFile(getLog(), readmeFile, sourceReadmeFile);<a name="line.469"></a>
+<span class="sourceLineNo">470</span>        symbolicLinkFiles.add(sourceReadmeFile);<a name="line.470"></a>
+<span class="sourceLineNo">471</span>        SharedFunctions.copyFile(getLog(), headerFile, binariesHeaderFile);<a name="line.471"></a>
+<span class="sourceLineNo">472</span>        symbolicLinkFiles.add(binariesHeaderFile);<a name="line.472"></a>
+<span class="sourceLineNo">473</span>        SharedFunctions.copyFile(getLog(), readmeFile, binariesReadmeFile);<a name="line.473"></a>
+<span class="sourceLineNo">474</span>        symbolicLinkFiles.add(binariesReadmeFile);<a name="line.474"></a>
+<span class="sourceLineNo">475</span>        return symbolicLinkFiles;<a name="line.475"></a>
+<span class="sourceLineNo">476</span>    }<a name="line.476"></a>
+<span class="sourceLineNo">477</span><a name="line.477"></a>
+<span class="sourceLineNo">478</span>    /**<a name="line.478"></a>
+<span class="sourceLineNo">479</span>     * This method is the setter for the {@link CommonsDistributionStagingMojo#baseDir} field, specifically<a name="line.479"></a>
+<span class="sourceLineNo">480</span>     * for the usage in the unit tests.<a name="line.480"></a>
+<span class="sourceLineNo">481</span>     *<a name="line.481"></a>
+<span class="sourceLineNo">482</span>     * @param baseDir is the {@link File} to be used as the project's root directory when this mojo<a name="line.482"></a>
+<span class="sourceLineNo">483</span>     *                is invoked.<a name="line.483"></a>
+<span class="sourceLineNo">484</span>     */<a name="line.484"></a>
+<span class="sourceLineNo">485</span>    protected void setBaseDir(final File baseDir) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>        this.baseDir = baseDir;<a name="line.486"></a>
+<span class="sourceLineNo">487</span>    }<a name="line.487"></a>
+<span class="sourceLineNo">488</span>}<a name="line.488"></a>