Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.java.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.java.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsDistributionStagingMojo.java.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1,520 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsDistributionStagingMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.source.html" class="el_package">org.apache.commons.release.plug in.mojos</a> > <span class="el_source">CommonsDistributionStagingMojo.java</span></div><h1>CommonsDistributionStagingMojo.java</h1><pre class="source lang-java linenums">/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.release.plugin.mojos; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.file.PathUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.release.plugin.SharedFunctions; +import org.apache.commons.release.plugin.velocity.HeaderHtmlVelocityDelegate; +import org.apache.commons.release.plugin.velocity.ReadmeHtmlVelocityDelegate; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.apache.maven.scm.ScmException; +import org.apache.maven.scm.ScmFileSet; +import org.apache.maven.scm.command.add.AddScmResult; +import org.apache.maven.scm.command.checkin.CheckInScmResult; +import org.apache.maven.scm.command.checkout.CheckOutScmResult; +import org.apache.maven.scm.manager.BasicScmManager; +import org.apache.maven.scm.manager.ScmManager; +import org.apache.maven.scm.provider.ScmProvider; +import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; +import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider; +import org.apache.maven.scm.repository.ScmRepository; +import org.apache.maven.settings.Settings; +import org.apache.maven.settings.crypto.SettingsDecrypter; + +/** + * This class checks out the dev distribution location, copies the distributions into that directory + * structure under the <code>target/commons-release-plugin/scm</code> directory. Then commits the + * distributions back up to SVN. Also, we include the built and zipped site as well as the RELEASE-NOTES.txt. + * + * @since 1.0 + */ +@Mojo(name = "stage-distributions", + defaultPhase = LifecyclePhase.DEPLOY, + threadSafe = true, + aggregator = true) +<span class="fc" id="L71">public class CommonsDistributionStagingMojo extends AbstractMojo {</span> + + /** The name of file generated from the README.vm velocity template to be checked into the dist svn repo. */ + private static final String README_FILE_NAME = "README.html"; + + /** The name of file generated from the HEADER.vm velocity template to be checked into the dist svn repo. */ + private static final String HEADER_FILE_NAME = "HEADER.html"; + + /** The name of the signature validation shell script to be checked into the dist svn repo. */ + private static final String SIGNATURE_VALIDATOR_NAME = "signature-validator.sh"; + /** + * The {@link MavenProject} object is essentially the context of the maven build at + * a given time. + */ + @Parameter(defaultValue = "${project}", required = true) + private MavenProject project; + + /** + * The {@link File} that contains a file to the root directory of the working project. Typically + * this directory is where the <code>pom.xml</code> resides. + */ + @Parameter(defaultValue = "${basedir}") + private File baseDir; + + /** The location to which the site gets built during running <code>mvn site</code>. */ + @Parameter(defaultValue = "${project.build.directory}/site", property = "commons.siteOutputDirectory") + private File siteDirectory; + + /** + * The main working directory for the plugin, namely <code>target/commons-release-plugin</code>, but + * that assumes that we're using the default maven <code>${project.build.directory}</code>. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", property = "commons.outputDirectory") + private File workingDirectory; + + /** + * The location to which to check out the dist subversion repository under our working directory, which + * was given above. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm", + property = "commons.distCheckoutDirectory") + private File distCheckoutDirectory; + + /** + * The location of the RELEASE-NOTES.txt file such that multi-module builds can configure it. + */ + @Parameter(defaultValue = "${basedir}/RELEASE-NOTES.txt", property = "commons.releaseNotesLocation") + private File releaseNotesFile; + + /** + * A boolean that determines whether or not we actually commit the files up to the subversion repository. + * If this is set to {@code true}, we do all but make the commits. We do checkout the repository in question + * though. + */ + @Parameter(property = "commons.release.dryRun", defaultValue = "false") + private Boolean dryRun; + + /** + * The url of the subversion repository to which we wish the artifacts to be staged. Typically this would need to + * be of the form: <code>scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo/version-RC#</code>. Note. that + * the prefix to the substring <code>https</code> is a requirement. + */ + @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl") + private String distSvnStagingUrl; + + /** + * A parameter to generally avoid running unless it is specifically turned on by the consuming module. + */ + @Parameter(defaultValue = "false", property = "commons.release.isDistModule") + private Boolean isDistModule; + + /** + * The release version of the artifact to be built. + */ + @Parameter(property = "commons.release.version") + private String commonsReleaseVersion; + + /** + * The RC version of the release. For example the first voted on candidate would be "RC1". + */ + @Parameter(property = "commons.rc.version") + private String commonsRcVersion; + + /** + * The ID of the server (specified in settings.xml) which should be used for dist authentication. + * This will be used in preference to {@link #username}/{@link #password}. + */ + @Parameter(property = "commons.distServer") + private String distServer; + + /** + * The username for the distribution subversion repository. This is typically your Apache id. + */ + @Parameter(property = "user.name") + private String username; + + /** + * The password associated with {@link CommonsDistributionStagingMojo#username}. + */ + @Parameter(property = "user.password") + private String password; + + /** + * Maven {@link Settings}. + */ + @Parameter(defaultValue = "${settings}", readonly = true, required = true) + private Settings settings; + + /** + * Maven {@link SettingsDecrypter} component. + */ + @Component + private SettingsDecrypter settingsDecrypter; + + /** + * A subdirectory of the dist directory into which we are going to stage the release candidate. We + * build this up in the {@link CommonsDistributionStagingMojo#execute()} method. And, for example, + * the directory should look like <code>https://dist.apache.org/repos/dist/dev/commons/text/1.4-RC1</code>. + */ + private File distRcVersionDirectory; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { +<span class="fc bfc" id="L194" title="All 2 branches covered."> if (!isDistModule) {</span> +<span class="fc" id="L195"> getLog().info("This module is marked as a non distribution "</span> + + "or assembly module, and the plugin will not run."); +<span class="fc" id="L197"> return;</span> + } +<span class="pc bpc" id="L199" title="1 of 2 branches missed."> if (StringUtils.isEmpty(distSvnStagingUrl)) {</span> +<span class="nc" id="L200"> getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");</span> +<span class="nc" id="L201"> return;</span> + } +<span class="pc bpc" id="L203" title="1 of 2 branches missed."> if (!workingDirectory.exists()) {</span> +<span class="nc" id="L204"> getLog().info("Current project contains no distributions. Not executing.");</span> +<span class="nc" id="L205"> return;</span> + } +<span class="fc" id="L207"> getLog().info("Preparing to stage distributions");</span> + try { +<span class="fc" id="L209"> final ScmManager scmManager = new BasicScmManager();</span> +<span class="fc" id="L210"> scmManager.setScmProvider("svn", new SvnExeScmProvider());</span> +<span class="fc" id="L211"> final ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);</span> +<span class="fc" id="L212"> final ScmProvider provider = scmManager.getProviderByRepository(repository);</span> +<span class="fc" id="L213"> final SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository</span> +<span class="fc" id="L214"> .getProviderRepository();</span> +<span class="fc" id="L215"> SharedFunctions.setAuthentication(</span> + providerRepository, + distServer, + settings, + settingsDecrypter, + username, + password + ); +<span class="fc" id="L223"> distRcVersionDirectory =</span> + new File(distCheckoutDirectory, commonsReleaseVersion + "-" + commonsRcVersion); +<span class="pc bpc" id="L225" title="1 of 2 branches missed."> if (!distCheckoutDirectory.exists()) {</span> +<span class="fc" id="L226"> SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);</span> + } +<span class="fc" id="L228"> final ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);</span> +<span class="fc" id="L229"> getLog().info("Checking out dist from: " + distSvnStagingUrl);</span> +<span class="fc" id="L230"> final CheckOutScmResult checkOutResult = provider.checkOut(repository, scmFileSet);</span> +<span class="pc bpc" id="L231" title="1 of 2 branches missed."> if (!checkOutResult.isSuccess()) {</span> +<span class="nc" id="L232"> throw new MojoExecutionException("Failed to checkout files from SCM: "</span> +<span class="nc" id="L233"> + checkOutResult.getProviderMessage() + " [" + checkOutResult.getCommandOutput() + "]");</span> + } +<span class="fc" id="L235"> final File copiedReleaseNotes = copyReleaseNotesToWorkingDirectory();</span> +<span class="fc" id="L236"> copyDistributionsIntoScmDirectoryStructureAndAddToSvn(copiedReleaseNotes,</span> + provider, repository); +<span class="fc" id="L238"> final List<File> filesToAdd = new ArrayList<>();</span> +<span class="fc" id="L239"> listNotHiddenFilesAndDirectories(distCheckoutDirectory, filesToAdd);</span> +<span class="pc bpc" id="L240" title="1 of 2 branches missed."> if (!dryRun) {</span> +<span class="nc" id="L241"> final ScmFileSet fileSet = new ScmFileSet(distCheckoutDirectory, filesToAdd);</span> +<span class="nc" id="L242"> final AddScmResult addResult = provider.add(</span> + repository, + fileSet + ); +<span class="nc bnc" id="L246" title="All 2 branches missed."> if (!addResult.isSuccess()) {</span> +<span class="nc" id="L247"> throw new MojoExecutionException("Failed to add files to SCM: " + addResult.getProviderMessage()</span> +<span class="nc" id="L248"> + " [" + addResult.getCommandOutput() + "]");</span> + } +<span class="nc" id="L250"> getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());</span> +<span class="nc" id="L251"> final CheckInScmResult checkInResult = provider.checkIn(</span> + repository, + fileSet, +<span class="nc" id="L254"> "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()</span> + ); +<span class="nc bnc" id="L256" title="All 2 branches missed."> if (!checkInResult.isSuccess()) {</span> +<span class="nc" id="L257"> getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());</span> +<span class="nc" id="L258"> throw new MojoExecutionException(</span> +<span class="nc" id="L259"> "Committing dist files failed: " + checkInResult.getCommandOutput()</span> + ); + } +<span class="nc" id="L262"> getLog().info("Committed revision " + checkInResult.getScmRevision());</span> +<span class="nc" id="L263"> } else {</span> +<span class="fc" id="L264"> getLog().info("[Dry run] Would have committed to: " + distSvnStagingUrl);</span> +<span class="fc" id="L265"> getLog().info(</span> +<span class="fc" id="L266"> "[Dry run] Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());</span> + } +<span class="nc" id="L268"> } catch (final ScmException e) {</span> +<span class="nc" id="L269"> getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);</span> +<span class="nc" id="L270"> throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);</span> +<span class="fc" id="L271"> }</span> +<span class="fc" id="L272"> }</span> + + /** + * Lists all directories and files to a flat list. + * @param directory {@link File} containing directory to list + * @param files a {@link List} of {@link File} to which to append the files. + */ + private void listNotHiddenFilesAndDirectories(final File directory, final List<File> files) { + // Get all the files and directories from a directory. +<span class="fc" id="L281"> final File[] fList = directory.listFiles();</span> +<span class="fc bfc" id="L282" title="All 2 branches covered."> for (final File file : fList) {</span> +<span class="pc bpc" id="L283" title="1 of 4 branches missed."> if (file.isFile() && !file.isHidden()) {</span> +<span class="fc" id="L284"> files.add(file);</span> +<span class="pc bpc" id="L285" title="1 of 4 branches missed."> } else if (file.isDirectory() && !file.isHidden()) {</span> +<span class="fc" id="L286"> files.add(file);</span> +<span class="fc" id="L287"> listNotHiddenFilesAndDirectories(file, files);</span> + } + } +<span class="fc" id="L290"> }</span> + + /** + * A utility method that takes the <code>RELEASE-NOTES.txt</code> file from the base directory of the + * project and copies it into {@link CommonsDistributionStagingMojo#workingDirectory}. + * + * @return the RELEASE-NOTES.txt file that exists in the <code>target/commons-release-notes/scm</code> + * directory for the purpose of adding it to the scm change set in the method + * {@link CommonsDistributionStagingMojo#copyDistributionsIntoScmDirectoryStructureAndAddToSvn(File, + * ScmProvider, ScmRepository)}. + * @throws MojoExecutionException if an {@link IOException} occurs as a wrapper so that maven + * can properly handle the exception. + */ + private File copyReleaseNotesToWorkingDirectory() throws MojoExecutionException { +<span class="fc" id="L304"> SharedFunctions.initDirectory(getLog(), distRcVersionDirectory);</span> +<span class="fc" id="L305"> getLog().info("Copying RELEASE-NOTES.txt to working directory.");</span> +<span class="fc" id="L306"> final File copiedReleaseNotes = new File(distRcVersionDirectory, releaseNotesFile.getName());</span> +<span class="fc" id="L307"> SharedFunctions.copyFile(getLog(), releaseNotesFile, copiedReleaseNotes);</span> +<span class="fc" id="L308"> return copiedReleaseNotes;</span> + } + + /** + * Copies the list of files at the root of the {@link CommonsDistributionStagingMojo#workingDirectory} into + * the directory structure of the distribution staging repository. Specifically: + * <ul> + * <li>root: + * <ul> + * <li>site</li> + * <li>site.zip</li> + * <li>RELEASE-NOTES.txt</li> + * <li>source: + * <ul> + * <li>-src artifacts....</li> + * </ul> + * </li> + * <li>binaries: + * <ul> + * <li>-bin artifacts....</li> + * </ul> + * </li> + * </ul> + * </li> + * </ul> + * + * @param copiedReleaseNotes is the RELEASE-NOTES.txt file that exists in the + * <code>target/commons-release-plugin/scm</code> directory. + * @param provider is the {@link ScmProvider} that we will use for adding the files we wish to commit. + * @param repository is the {@link ScmRepository} that we will use for adding the files that we wish to commit. + * @return a {@link List} of {@link File}'s in the directory for the purpose of adding them to the maven + * {@link ScmFileSet}. + * @throws MojoExecutionException if an {@link IOException} occurs so that Maven can handle it properly. + */ + private List<File> copyDistributionsIntoScmDirectoryStructureAndAddToSvn(final File copiedReleaseNotes, + final ScmProvider provider, + final ScmRepository repository) + throws MojoExecutionException { +<span class="fc" id="L346"> final List<File> workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());</span> +<span class="fc" id="L347"> final List<File> filesForMavenScmFileSet = new ArrayList<>();</span> +<span class="fc" id="L348"> final File scmBinariesRoot = new File(distRcVersionDirectory, "binaries");</span> +<span class="fc" id="L349"> final File scmSourceRoot = new File(distRcVersionDirectory, "source");</span> +<span class="fc" id="L350"> SharedFunctions.initDirectory(getLog(), scmBinariesRoot);</span> +<span class="fc" id="L351"> SharedFunctions.initDirectory(getLog(), scmSourceRoot);</span> + File copy; +<span class="fc bfc" id="L353" title="All 2 branches covered."> for (final File file : workingDirectoryFiles) {</span> +<span class="fc bfc" id="L354" title="All 2 branches covered."> if (file.getName().contains("src")) {</span> +<span class="fc" id="L355"> copy = new File(scmSourceRoot, file.getName());</span> +<span class="fc" id="L356"> SharedFunctions.copyFile(getLog(), file, copy);</span> +<span class="fc" id="L357"> filesForMavenScmFileSet.add(file);</span> +<span class="fc bfc" id="L358" title="All 2 branches covered."> } else if (file.getName().contains("bin")) {</span> +<span class="fc" id="L359"> copy = new File(scmBinariesRoot, file.getName());</span> +<span class="fc" id="L360"> SharedFunctions.copyFile(getLog(), file, copy);</span> +<span class="fc" id="L361"> filesForMavenScmFileSet.add(file);</span> +<span class="pc bpc" id="L362" title="1 of 2 branches missed."> } else if (StringUtils.containsAny(file.getName(), "scm", "sha256.properties", "sha512.properties")) {</span> +<span class="fc" id="L363"> getLog().debug("Not copying scm directory over to the scm directory because it is the scm directory.");</span> + //do nothing because we are copying into scm + } else { +<span class="nc" id="L366"> copy = new File(distCheckoutDirectory.getAbsolutePath(), file.getName());</span> +<span class="nc" id="L367"> SharedFunctions.copyFile(getLog(), file, copy);</span> +<span class="nc" id="L368"> filesForMavenScmFileSet.add(file);</span> + } +<span class="fc" id="L370"> }</span> +<span class="fc" id="L371"> filesForMavenScmFileSet.addAll(buildReadmeAndHeaderHtmlFiles());</span> +<span class="fc" id="L372"> filesForMavenScmFileSet.add(copySignatureValidatorScriptToScmDirectory());</span> +<span class="fc" id="L373"> filesForMavenScmFileSet.addAll(copySiteToScmDirectory());</span> +<span class="fc" id="L374"> return filesForMavenScmFileSet;</span> + } + + /** + * Copies our <code>signature-validator.sh</code> script into + * <code>${basedir}/target/commons-release-plugin/scm/signature-validator.sh</code>. + * + * @return the {@link File} for the signature-validator.sh + * @throws MojoExecutionException if an error occurs while the resource is being copied + */ + private File copySignatureValidatorScriptToScmDirectory() throws MojoExecutionException { +<span class="fc" id="L385"> final Path scmTargetPath = Paths.get(distRcVersionDirectory.toString(), SIGNATURE_VALIDATOR_NAME);</span> +<span class="fc" id="L386"> final String name = "/resources/" + SIGNATURE_VALIDATOR_NAME;</span> + // The source can be in a local file or inside a jar file. + try { +<span class="fc" id="L389"> PathUtils.copyFile(getClass().getResource(name), scmTargetPath);</span> +<span class="nc" id="L390"> } catch (final Exception e) {</span> +<span class="nc" id="L391"> throw new MojoExecutionException(String.format("Failed to copy '%s' to '%s'", name, scmTargetPath), e);</span> +<span class="fc" id="L392"> }</span> +<span class="fc" id="L393"> return scmTargetPath.toFile();</span> + } + + /** + * Copies <code>${basedir}/target/site</code> to <code>${basedir}/target/commons-release-plugin/scm/site</code>. + * + * @return the {@link List} of {@link File}'s contained in + * <code>${basedir}/target/commons-release-plugin/scm/site</code>, after the copy is complete. + * @throws MojoExecutionException if the site copying fails for some reason. + */ + private List<File> copySiteToScmDirectory() throws MojoExecutionException { +<span class="pc bpc" id="L404" title="1 of 2 branches missed."> if (!siteDirectory.exists()) {</span> +<span class="nc" id="L405"> getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");</span> +<span class="nc" id="L406"> throw new MojoExecutionException(</span> + "\"mvn site\" was not run before this goal, or a siteDirectory did not exist." + ); + } +<span class="fc" id="L410"> final File siteInScm = new File(distRcVersionDirectory, "site");</span> + try { +<span class="fc" id="L412"> FileUtils.copyDirectory(siteDirectory, siteInScm);</span> +<span class="nc" id="L413"> } catch (final IOException e) {</span> +<span class="nc" id="L414"> throw new MojoExecutionException("Site copying failed", e);</span> +<span class="fc" id="L415"> }</span> +<span class="fc" id="L416"> return new ArrayList<>(FileUtils.listFiles(siteInScm, null, true));</span> + } + + /** + * Builds up <code>README.html</code> and <code>HEADER.html</code> that reside in following. + * <ul> + * <li>distRoot + * <ul> + * <li>binaries/HEADER.html (symlink)</li> + * <li>binaries/README.html (symlink)</li> + * <li>source/HEADER.html (symlink)</li> + * <li>source/README.html (symlink)</li> + * <li>HEADER.html</li> + * <li>README.html</li> + * </ul> + * </li> + * </ul> + * @return the {@link List} of created files above + * @throws MojoExecutionException if an {@link IOException} occurs in the creation of these + * files fails. + */ + private List<File> buildReadmeAndHeaderHtmlFiles() throws MojoExecutionException { +<span class="fc" id="L438"> final List<File> headerAndReadmeFiles = new ArrayList<>();</span> +<span class="fc" id="L439"> final File headerFile = new File(distRcVersionDirectory, HEADER_FILE_NAME);</span> + // + // HEADER file + // +<span class="fc" id="L443"> try (Writer headerWriter = new OutputStreamWriter(Files.newOutputStream(headerFile.toPath()),</span> + StandardCharsets.UTF_8)) { +<span class="fc" id="L445"> HeaderHtmlVelocityDelegate.builder().build().render(headerWriter);</span> +<span class="nc" id="L446"> } catch (final IOException e) {</span> +<span class="nc" id="L447"> final String message = "Could not build HEADER html file " + headerFile;</span> +<span class="nc" id="L448"> getLog().error(message, e);</span> +<span class="nc" id="L449"> throw new MojoExecutionException(message, e);</span> +<span class="fc" id="L450"> }</span> +<span class="fc" id="L451"> headerAndReadmeFiles.add(headerFile);</span> + // + // README file + // +<span class="fc" id="L455"> final File readmeFile = new File(distRcVersionDirectory, README_FILE_NAME);</span> +<span class="fc" id="L456"> try (Writer readmeWriter = new OutputStreamWriter(Files.newOutputStream(readmeFile.toPath()),</span> + StandardCharsets.UTF_8)) { + // @formatter:off +<span class="fc" id="L459"> final ReadmeHtmlVelocityDelegate readmeHtmlVelocityDelegate = ReadmeHtmlVelocityDelegate.builder()</span> +<span class="fc" id="L460"> .withArtifactId(project.getArtifactId())</span> +<span class="fc" id="L461"> .withVersion(project.getVersion())</span> +<span class="fc" id="L462"> .withSiteUrl(project.getUrl())</span> +<span class="fc" id="L463"> .build();</span> + // @formatter:on +<span class="fc" id="L465"> readmeHtmlVelocityDelegate.render(readmeWriter);</span> +<span class="nc" id="L466"> } catch (final IOException e) {</span> +<span class="nc" id="L467"> final String message = "Could not build README html file " + readmeFile;</span> +<span class="nc" id="L468"> getLog().error(message, e);</span> +<span class="nc" id="L469"> throw new MojoExecutionException(message, e);</span> +<span class="fc" id="L470"> }</span> +<span class="fc" id="L471"> headerAndReadmeFiles.add(readmeFile);</span> + // + // signature-validator.sh file copy + // +<span class="fc" id="L475"> headerAndReadmeFiles.addAll(copyHeaderAndReadmeToSubdirectories(headerFile, readmeFile));</span> +<span class="fc" id="L476"> return headerAndReadmeFiles;</span> + } + + /** + * Copies <code>README.html</code> and <code>HEADER.html</code> to the source and binaries + * directories. + * + * @param headerFile The originally created <code>HEADER.html</code> file. + * @param readmeFile The originally created <code>README.html</code> file. + * @return a {@link List} of created files. + * @throws MojoExecutionException if the {@link SharedFunctions#copyFile(Log, File, File)} + * fails. + */ + private List<File> copyHeaderAndReadmeToSubdirectories(final File headerFile, final File readmeFile) + throws MojoExecutionException { +<span class="fc" id="L491"> final List<File> symbolicLinkFiles = new ArrayList<>();</span> +<span class="fc" id="L492"> final File sourceRoot = new File(distRcVersionDirectory, "source");</span> +<span class="fc" id="L493"> final File binariesRoot = new File(distRcVersionDirectory, "binaries");</span> +<span class="fc" id="L494"> final File sourceHeaderFile = new File(sourceRoot, HEADER_FILE_NAME);</span> +<span class="fc" id="L495"> final File sourceReadmeFile = new File(sourceRoot, README_FILE_NAME);</span> +<span class="fc" id="L496"> final File binariesHeaderFile = new File(binariesRoot, HEADER_FILE_NAME);</span> +<span class="fc" id="L497"> final File binariesReadmeFile = new File(binariesRoot, README_FILE_NAME);</span> +<span class="fc" id="L498"> SharedFunctions.copyFile(getLog(), headerFile, sourceHeaderFile);</span> +<span class="fc" id="L499"> symbolicLinkFiles.add(sourceHeaderFile);</span> +<span class="fc" id="L500"> SharedFunctions.copyFile(getLog(), readmeFile, sourceReadmeFile);</span> +<span class="fc" id="L501"> symbolicLinkFiles.add(sourceReadmeFile);</span> +<span class="fc" id="L502"> SharedFunctions.copyFile(getLog(), headerFile, binariesHeaderFile);</span> +<span class="fc" id="L503"> symbolicLinkFiles.add(binariesHeaderFile);</span> +<span class="fc" id="L504"> SharedFunctions.copyFile(getLog(), readmeFile, binariesReadmeFile);</span> +<span class="fc" id="L505"> symbolicLinkFiles.add(binariesReadmeFile);</span> +<span class="fc" id="L506"> return symbolicLinkFiles;</span> + } + + /** + * This method is the setter for the {@link CommonsDistributionStagingMojo#baseDir} field, specifically + * for the usage in the unit tests. + * + * @param baseDir is the {@link File} to be used as the project's root directory when this mojo + * is invoked. + */ + protected void setBaseDir(final File baseDir) { +<span class="fc" id="L517"> this.baseDir = baseDir;</span> +<span class="fc" id="L518"> }</span> +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file
Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsSiteCompressionMojo</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.html" class="el_package">org.apache.commons.release.plugin.mojos</a> > <span class="el_class">CommonsSiteCompressionMojo</span></div><h1>CommonsSiteCompressionMojo< /h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">42 of 196</td><td class="ctr2">78%</td><td class="bar">4 of 16</td><td cl ass="ctr2">75%</td><td class="ctr1">4</td><td class="ctr2">13</td><td class="ctr1">9</td><td class="ctr2">44</td><td class="ctr1">0</td><td class="ctr2">5</td></tr></tfoot><tbody><tr><td id="a2"><a href="CommonsSiteCompressionMojo.java.html#L88" class="el_method">execute()</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="51" height="10" title="38" alt="38"/><img src="../jacoco-resources/greenbar.gif" width="68" height="10" title="51" alt="51"/></td><td class="ctr2" id="c4">57%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="30" height="10" title="2" alt="2"/><img src="../jacoco-resources/greenbar.gif" width="90" height="10" title="6" alt="6"/></td><td class="ctr2" id="e0">75%</td><td class="ctr1" id="f0">2</td><td class="ctr2" id="g0">5</td><td class="ctr1" id="h0">8</td><td class="ctr2" id="i0">21</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a3"><a href="CommonsSiteCompressionMojo.jav a.html#L128" class="el_method">getAllSiteFiles(File, List)</a></td><td class="bar" id="b1"><img src="../jacoco-resources/redbar.gif" width="5" height="10" title="4" alt="4"/><img src="../jacoco-resources/greenbar.gif" width="36" height="10" title="27" alt="27"/></td><td class="ctr2" id="c3">87%</td><td class="bar" id="d1"><img src="../jacoco-resources/redbar.gif" width="15" height="10" title="1" alt="1"/><img src="../jacoco-resources/greenbar.gif" width="45" height="10" title="3" alt="3"/></td><td class="ctr2" id="e1">75%</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g1">3</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i3">6</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a4"><a href="CommonsSiteCompressionMojo.java.html#L150" class="el_method">writeZipFile(File, File, List)</a></td><td class="bar" id="b2"><img src="../jacoco-resources/greenbar.gif" width="56" height="10" title="42" alt="42"/></td><td class="ctr2" id="c0">100%</t d><td class="bar" id="d2"><img src="../jacoco-resources/redbar.gif" width="15" height="10" title="1" alt="1"/><img src="../jacoco-resources/greenbar.gif" width="45" height="10" title="3" alt="3"/></td><td class="ctr2" id="e2">75%</td><td class="ctr1" id="f2">1</td><td class="ctr2" id="g2">3</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i1">8</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a0"><a href="CommonsSiteCompressionMojo.java.html#L172" class="el_method">addToZip(File, File, ZipOutputStream)</a></td><td class="bar" id="b3"><img src="../jacoco-resources/greenbar.gif" width="41" height="10" title="31" alt="31"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i2">8</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a1"><a href="CommonsSiteComp ressionMojo.java.html#L51" class="el_method">CommonsSiteCompressionMojo()</a></td><td class="bar" id="b4"><img src="../jacoco-resources/greenbar.gif" width="4" height="10" title="3" alt="3"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">1</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.java.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.java.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsSiteCompressionMojo.java.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1,184 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsSiteCompressionMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.source.html" class="el_package">org.apache.commons.release.plugin.m ojos</a> > <span class="el_source">CommonsSiteCompressionMojo.java</span></div><h1>CommonsSiteCompressionMojo.java</h1><pre class="source lang-java linenums">/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.release.plugin.mojos; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; + +/** + * Takes the built <code>./target/site</code> directory and compresses it to + * <code>./target/commons-release-plugin/site.zip</code>. + * + * @since 1.0 + * @deprecated - as we no longer wish to compress the site, we are going to put this functionality in the + * {@link CommonsDistributionStagingMojo}. + */ +@Deprecated +@Mojo(name = "compress-site", + defaultPhase = LifecyclePhase.POST_SITE, + threadSafe = true, + aggregator = true) +<span class="fc" id="L51">public class CommonsSiteCompressionMojo extends AbstractMojo {</span> + + /** + * The working directory for the plugin which, assuming the maven uses the default + * <code>${project.build.directory}</code>, this becomes <code>target/commons-release-plugin</code>. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", + property = "commons.outputDirectory") + private File workingDirectory; + + /** + */ + @Parameter(defaultValue = "${project.build.directory}/site", property = "commons.siteOutputDirectory") + private File siteDirectory; + + /** + * The url of the subversion repository to which we wish the artifacts to be staged. Typically + * this would need to be of the form: + * <code>scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo</code>. Note. that the prefix to the + * substring <code>https</code> is a requirement. + */ + @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl") + private String distSvnStagingUrl; + + /** + * A parameter to generally avoid running unless it is specifically turned on by the consuming module. + */ + @Parameter(defaultValue = "false", property = "commons.release.isDistModule") + private Boolean isDistModule; + + /** + * The list of files to compress into the site.zip file. + */ + private List<File> filesToCompress; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { +<span class="pc bpc" id="L88" title="1 of 2 branches missed."> if (!isDistModule) {</span> +<span class="nc" id="L89"> getLog().info("This module is marked as a non distribution "</span> + + "or assembly module, and the plugin will not run."); +<span class="nc" id="L91"> return;</span> + } +<span class="pc bpc" id="L93" title="1 of 2 branches missed."> if (StringUtils.isEmpty(distSvnStagingUrl)) {</span> +<span class="nc" id="L94"> getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");</span> +<span class="nc" id="L95"> return;</span> + } +<span class="fc bfc" id="L97" title="All 2 branches covered."> if (!siteDirectory.exists()) {</span> +<span class="fc" id="L98"> getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");</span> +<span class="fc" id="L99"> throw new MojoFailureException(</span> + "\"mvn site\" was not run before this goal, or a siteDirectory did not exist." + ); + } +<span class="fc bfc" id="L103" title="All 2 branches covered."> if (!workingDirectory.exists()) {</span> +<span class="fc" id="L104"> getLog().info("Current project contains no distributions. Not executing.");</span> +<span class="fc" id="L105"> return;</span> + } + try { +<span class="fc" id="L108"> filesToCompress = new ArrayList<>();</span> +<span class="fc" id="L109"> getAllSiteFiles(siteDirectory, filesToCompress);</span> +<span class="fc" id="L110"> writeZipFile(workingDirectory, siteDirectory, filesToCompress);</span> +<span class="nc" id="L111"> } catch (final IOException e) {</span> +<span class="nc" id="L112"> getLog().error("Failed to create ./target/commons-release-plugin/site.zip: " + e.getMessage(), e);</span> +<span class="nc" id="L113"> throw new MojoExecutionException(</span> +<span class="nc" id="L114"> "Failed to create ./target/commons-release-plugin/site.zip: " + e.getMessage(),</span> + e + ); +<span class="fc" id="L117"> }</span> +<span class="fc" id="L118"> }</span> + + /** + * By default this method iterates across the <code>target/site</code> directory and adds all the files + * to the {@link CommonsSiteCompressionMojo#filesToCompress} {@link List}. + * + * @param siteDirectory the {@link File} that represents the <code>target/site</code> directory. + * @param filesToCompress the {@link List} to which to add all the files. + */ + private void getAllSiteFiles(final File siteDirectory, final List<File> filesToCompress) { +<span class="fc" id="L128"> final File[] files = siteDirectory.listFiles();</span> +<span class="fc bfc" id="L129" title="All 2 branches covered."> for (final File file : files) {</span> +<span class="fc" id="L130"> filesToCompress.add(file);</span> +<span class="pc bpc" id="L131" title="1 of 2 branches missed."> if (file.isDirectory()) {</span> +<span class="nc" id="L132"> getAllSiteFiles(file, filesToCompress);</span> + } + } +<span class="fc" id="L135"> }</span> + + /** + * A helper method for writing all the files in our <code>fileList</code> to a <code>site.zip</code> file + * in the <code>workingDirectory</code>. + * + * @param outputDirectory is a {@link File} representing the place to put the site.zip file. + * @param directoryToZip is a {@link File} representing the directory of the site (normally + * <code>target/site</code>). + * @param fileList the list of files to be zipped up, generally generated by + * {@link CommonsSiteCompressionMojo#getAllSiteFiles(File, List)}. + * @throws IOException when the copying of the files goes incorrectly. + */ + private void writeZipFile(final File outputDirectory, final File directoryToZip, final List<File> fileList) + throws IOException { +<span class="fc" id="L150"> try (OutputStream fos = Files.newOutputStream(new File(outputDirectory.getAbsolutePath() + "/site.zip")</span> +<span class="fc" id="L151"> .toPath());</span> +<span class="fc" id="L152"> ZipOutputStream zos = new ZipOutputStream(fos)) {</span> +<span class="fc bfc" id="L153" title="All 2 branches covered."> for (final File file : fileList) {</span> +<span class="pc bpc" id="L154" title="1 of 2 branches missed."> if (!file.isDirectory()) { // we only ZIP files, not directories</span> +<span class="fc" id="L155"> addToZip(directoryToZip, file, zos);</span> + } +<span class="fc" id="L157"> }</span> + } +<span class="fc" id="L159"> }</span> + + /** + * Given the <code>directoryToZip</code> we add the <code>file</code> to the ZIP archive represented by + * <code>zos</code>. + * + * @param directoryToZip a {@link File} representing the directory from which the file exists that we are + * compressing. Generally this is <code>target/site</code>. + * @param file a {@link File} to add to the {@link ZipOutputStream} <code>zos</code>. + * @param zos the {@link ZipOutputStream} to which to add our <code>file</code>. + * @throws IOException if adding the <code>file</code> doesn't work out properly. + */ + private void addToZip(final File directoryToZip, final File file, final ZipOutputStream zos) throws IOException { +<span class="fc" id="L172"> try (InputStream fis = Files.newInputStream(file.toPath())) {</span> + // we want the zipEntry's path to be a relative path that is relative + // to the directory being zipped, so chop off the rest of the path +<span class="fc" id="L175"> final String zipFilePath = file.getCanonicalPath().substring(</span> +<span class="fc" id="L176"> directoryToZip.getCanonicalPath().length() + 1,</span> +<span class="fc" id="L177"> file.getCanonicalPath().length());</span> +<span class="fc" id="L178"> final ZipEntry zipEntry = new ZipEntry(zipFilePath);</span> +<span class="fc" id="L179"> zos.putNextEntry(zipEntry);</span> +<span class="fc" id="L180"> IOUtils.copy(fis, zos);</span> + } +<span class="fc" id="L182"> }</span> +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsStagingCleanupMojo.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsStagingCleanupMojo.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsStagingCleanupMojo.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsStagingCleanupMojo</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.html" class="el_package">org.apache.commons.release.plugin.mojos</a> > <span class="el_class">CommonsStagingCleanupMojo</span></div><h1>CommonsStagingCleanupMojo</h1 ><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td >class="sortable" id="a" onclick="toggleSort(this)">Element</td><td >class="down sortable bar" id="b" onclick="toggleSort(this)">Missed >Instructions</td><td class="sortable ctr2" id="c" >onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" >onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" >id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" >onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" >onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" >onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" >onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" >onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" >onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td > class="bar">148 of 238</td><td class="ctr2">37%</td><td class="bar">11 of >16</td><td cla ss="ctr2">31%</td><td class="ctr1">8</td><td class="ctr2">10</td><td class="ctr1">26</td><td class="ctr2">45</td><td class="ctr1">0</td><td class="ctr2">2</td></tr></tfoot><tbody><tr><td id="a1"><a href="CommonsStagingCleanupMojo.java.html#L136" class="el_method">execute()</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="75" height="10" title="148" alt="148"/><img src="../jacoco-resources/greenbar.gif" width="44" height="10" title="87" alt="87"/></td><td class="ctr2" id="c1">37%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="82" height="10" title="11" alt="11"/><img src="../jacoco-resources/greenbar.gif" width="37" height="10" title="5" alt="5"/></td><td class="ctr2" id="e0">31%</td><td class="ctr1" id="f0">8</td><td class="ctr2" id="g0">9</td><td class="ctr1" id="h0">26</td><td class="ctr2" id="i0">44</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a0"><a href="CommonsStagingCleanupMojo .java.html#L57" class="el_method">CommonsStagingCleanupMojo()</a></td><td class="bar" id="b1"><img src="../jacoco-resources/greenbar.gif" width="1" height="10" title="3" alt="3"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">1</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsStagingCleanupMojo.java.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsStagingCleanupMojo.java.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/CommonsStagingCleanupMojo.java.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>CommonsStagingCleanupMojo.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.source.html" class="el_package">org.apache.commons.release.plugin.mo jos</a> > <span class="el_source">CommonsStagingCleanupMojo.java</span></div><h1>CommonsStagingCleanupMojo.java</h1><pre class="source lang-java linenums">/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.commons.release.plugin.mojos; + +import java.io.File; +import java.util.Arrays; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.release.plugin.SharedFunctions; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.apache.maven.scm.ScmException; +import org.apache.maven.scm.ScmFileSet; +import org.apache.maven.scm.command.checkin.CheckInScmResult; +import org.apache.maven.scm.command.checkout.CheckOutScmResult; +import org.apache.maven.scm.command.remove.RemoveScmResult; +import org.apache.maven.scm.manager.BasicScmManager; +import org.apache.maven.scm.manager.ScmManager; +import org.apache.maven.scm.provider.ScmProvider; +import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; +import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider; +import org.apache.maven.scm.repository.ScmRepository; +import org.apache.maven.settings.Settings; +import org.apache.maven.settings.crypto.SettingsDecrypter; + +/** + * This class checks out the dev distribution location, checks whether anything exists in the + * distribution location, and if it is non-empty it deletes all the resources there. + * + * @since 1.6 + */ +@Mojo(name = "clean-staging", + defaultPhase = LifecyclePhase.POST_CLEAN, + threadSafe = true, + aggregator = true) +<span class="fc" id="L57">public class CommonsStagingCleanupMojo extends AbstractMojo {</span> + + /** + * The {@link MavenProject} object is essentially the context of the maven build at + * a given time. + */ + @Parameter(defaultValue = "${project}", required = true) + private MavenProject project; + + /** + * The main working directory for the plugin, namely <code>target/commons-release-plugin</code>, but + * that assumes that we're using the default maven <code>${project.build.directory}</code>. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", property = "commons.outputDirectory") + private File workingDirectory; + + /** + * The location to which to checkout the dist subversion repository under our working directory, which + * was given above. We then do an SVN delete on all the directories in this repository. + */ + @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm-cleanup", + property = "commons.distCleanupDirectory") + private File distCleanupDirectory; + + /** + * A boolean that determines whether or not we actually commit the files up to the subversion repository. + * If this is set to {@code true}, we do all but make the commits. We do checkout the repository in question + * though. + */ + @Parameter(property = "commons.release.dryRun", defaultValue = "false") + private Boolean dryRun; + + /** + * The url of the subversion repository to which we wish the artifacts to be staged. Typically this would need to + * be of the form: <code>scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo/version-RC#</code>. Note. that + * the prefix to the substring <code>https</code> is a requirement. + */ + @Parameter(defaultValue = "", property = "commons.distSvnStagingUrl") + private String distSvnStagingUrl; + + /** + * A parameter to generally avoid running unless it is specifically turned on by the consuming module. + */ + @Parameter(defaultValue = "false", property = "commons.release.isDistModule") + private Boolean isDistModule; + + /** + * The ID of the server (specified in settings.xml) which should be used for dist authentication. + * This will be used in preference to {@link #username}/{@link #password}. + */ + @Parameter(property = "commons.distServer") + private String distServer; + + /** + * The username for the distribution subversion repository. This is typically your Apache id. + */ + @Parameter(property = "user.name") + private String username; + + /** + * The password associated with {@link CommonsDistributionStagingMojo#username}. + */ + @Parameter(property = "user.password") + private String password; + + /** + * Maven {@link Settings}. + */ + @Parameter(defaultValue = "${settings}", readonly = true, required = true) + private Settings settings; + + /** + * Maven {@link SettingsDecrypter} component. + */ + @Component + private SettingsDecrypter settingsDecrypter; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { +<span class="pc bpc" id="L136" title="1 of 2 branches missed."> if (!isDistModule) {</span> +<span class="nc" id="L137"> getLog().info("This module is marked as a non distribution "</span> + + "or assembly module, and the plugin will not run."); +<span class="nc" id="L139"> return;</span> + } +<span class="pc bpc" id="L141" title="1 of 2 branches missed."> if (StringUtils.isEmpty(distSvnStagingUrl)) {</span> +<span class="nc" id="L142"> getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");</span> +<span class="nc" id="L143"> return;</span> + } +<span class="pc bpc" id="L145" title="1 of 2 branches missed."> if (!workingDirectory.exists()) {</span> +<span class="nc" id="L146"> SharedFunctions.initDirectory(getLog(), workingDirectory);</span> + } + try { +<span class="fc" id="L149"> final ScmManager scmManager = new BasicScmManager();</span> +<span class="fc" id="L150"> scmManager.setScmProvider("svn", new SvnExeScmProvider());</span> +<span class="fc" id="L151"> final ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);</span> +<span class="fc" id="L152"> final ScmProvider provider = scmManager.getProviderByRepository(repository);</span> +<span class="fc" id="L153"> final SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository</span> +<span class="fc" id="L154"> .getProviderRepository();</span> +<span class="fc" id="L155"> SharedFunctions.setAuthentication(</span> + providerRepository, + distServer, + settings, + settingsDecrypter, + username, + password + ); +<span class="fc" id="L163"> getLog().info("Checking out dist from: " + distSvnStagingUrl);</span> +<span class="fc" id="L164"> final ScmFileSet scmFileSet = new ScmFileSet(distCleanupDirectory);</span> +<span class="fc" id="L165"> final CheckOutScmResult checkOutResult = provider.checkOut(repository, scmFileSet);</span> +<span class="pc bpc" id="L166" title="1 of 2 branches missed."> if (!checkOutResult.isSuccess()) {</span> +<span class="nc" id="L167"> throw new MojoExecutionException("Failed to checkout files from SCM: "</span> +<span class="nc" id="L168"> + checkOutResult.getProviderMessage() + " [" + checkOutResult.getCommandOutput() + "]");</span> + } +<span class="fc" id="L170"> final List<File> filesToRemove = Arrays.asList(distCleanupDirectory.listFiles());</span> +<span class="pc bpc" id="L171" title="1 of 2 branches missed."> if (filesToRemove.size() == 1) {</span> +<span class="fc" id="L172"> getLog().info("No files to delete");</span> +<span class="fc" id="L173"> return;</span> + } +<span class="nc bnc" id="L175" title="All 2 branches missed."> if (!dryRun) {</span> +<span class="nc" id="L176"> final ScmFileSet fileSet = new ScmFileSet(distCleanupDirectory, filesToRemove);</span> +<span class="nc" id="L177"> final RemoveScmResult removeScmResult = provider.remove(repository, fileSet,</span> + "Cleaning up staging area"); +<span class="nc bnc" id="L179" title="All 2 branches missed."> if (!removeScmResult.isSuccess()) {</span> +<span class="nc" id="L180"> throw new MojoFailureException("Failed to remove files from SCM: "</span> +<span class="nc" id="L181"> + removeScmResult.getProviderMessage()</span> +<span class="nc" id="L182"> + " [" + removeScmResult.getCommandOutput() + "]");</span> + } +<span class="nc" id="L184"> getLog().info("Cleaning distribution area for: " + project.getArtifactId());</span> +<span class="nc" id="L185"> final CheckInScmResult checkInResult = provider.checkIn(</span> + repository, + fileSet, +<span class="nc" id="L188"> "Cleaning distribution area for: " + project.getArtifactId()</span> + ); +<span class="nc bnc" id="L190" title="All 2 branches missed."> if (!checkInResult.isSuccess()) {</span> +<span class="nc" id="L191"> throw new MojoFailureException("Failed to commit files: " + removeScmResult.getProviderMessage()</span> +<span class="nc" id="L192"> + " [" + removeScmResult.getCommandOutput() + "]");</span> + } +<span class="nc" id="L194"> } else {</span> +<span class="nc" id="L195"> getLog().info("Would have attempted to delete files from: " + distSvnStagingUrl);</span> + } +<span class="nc" id="L197"> } catch (final ScmException e) {</span> +<span class="nc" id="L198"> throw new MojoFailureException(e.getMessage());</span> +<span class="nc" id="L199"> }</span> + +<span class="nc" id="L201"> }</span> +} +</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/index.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/index.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/index.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>org.apache.commons.release.plugin.mojos</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.source.html" class="el_source">Source Files</a><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <span class="el_package">org.apache.commons.release.plugin.mojos</span></div><h1>org.apach e.commons.release.plugin.mojos</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">553 of 1,704</td><td class="ctr2">67%</td><td class="bar">31 of 88</td><td class="ctr2">64%</td><td class="ctr1">26</td><td class="ctr2">70</td><td class="ctr1">96</td><td class="ctr2">334</td><td class="ctr1">0</td><td class="ctr2">26</td><td class="ctr1">0</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td id="a1"><a href="CommonsDistributionStagingMojo.html" class="el_class">CommonsDistributionStagingMojo</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="37" height="10" title="268" alt="268"/><img src="../jacoco-resources/greenbar.gif" width="82" height="10" title="580" alt="580"/></td><td class="ctr2" id="c2">68%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="43" height="10" title="13" alt="13"/><img src="../jacoco-resources/greenbar.gif" width="76" height="10" title="23" alt="23"/></td><td class="ctr2" id="e2">63%< /td><td class="ctr1" id="f0">11</td><td class="ctr2" id="g0">28</td><td class="ctr1" id="h0">40</td><td class="ctr2" id="i0">152</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">10</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a3"><a href="CommonsStagingCleanupMojo.html" class="el_class">CommonsStagingCleanupMojo</a></td><td class="bar" id="b1"><img src="../jacoco-resources/redbar.gif" width="20" height="10" title="148" alt="148"/><img src="../jacoco-resources/greenbar.gif" width="12" height="10" title="90" alt="90"/></td><td class="ctr2" id="c3">37%</td><td class="bar" id="d1"><img src="../jacoco-resources/redbar.gif" width="36" height="10" title="11" alt="11"/><img src="../jacoco-resources/greenbar.gif" width="16" height="10" title="5" alt="5"/></td><td class="ctr2" id="e3">31%</td><td class="ctr1" id="f1">8</td><td class="ctr2" id="g3">10</td><td class="ctr1" id="h1">26</td><td class="ctr2" id="i2">45</td><td class="ctr1" id="j1">0< /td><td class="ctr2" id="k3">2</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a0"><a href="CommonsDistributionDetachmentMojo.html" class="el_class">CommonsDistributionDetachmentMojo</a></td><td class="bar" id="b2"><img src="../jacoco-resources/redbar.gif" width="13" height="10" title="95" alt="95"/><img src="../jacoco-resources/greenbar.gif" width="46" height="10" title="327" alt="327"/></td><td class="ctr2" id="c1">77%</td><td class="bar" id="d3"><img src="../jacoco-resources/redbar.gif" width="10" height="10" title="3" alt="3"/><img src="../jacoco-resources/greenbar.gif" width="56" height="10" title="17" alt="17"/></td><td class="ctr2" id="e0">85%</td><td class="ctr1" id="f3">3</td><td class="ctr2" id="g1">19</td><td class="ctr1" id="h2">21</td><td class="ctr2" id="i1">93</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k1">9</td><td class="ctr1" id="l2">0</td><td class="ctr2" id="m2">1</td></tr><tr><td id="a2"><a href="CommonsSiteCompres sionMojo.html" class="el_class">CommonsSiteCompressionMojo</a></td><td class="bar" id="b3"><img src="../jacoco-resources/redbar.gif" width="5" height="10" title="42" alt="42"/><img src="../jacoco-resources/greenbar.gif" width="21" height="10" title="154" alt="154"/></td><td class="ctr2" id="c0">78%</td><td class="bar" id="d2"><img src="../jacoco-resources/redbar.gif" width="13" height="10" title="4" alt="4"/><img src="../jacoco-resources/greenbar.gif" width="40" height="10" title="12" alt="12"/></td><td class="ctr2" id="e1">75%</td><td class="ctr1" id="f2">4</td><td class="ctr2" id="g2">13</td><td class="ctr1" id="h3">9</td><td class="ctr2" id="i3">44</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k2">5</td><td class="ctr1" id="l3">0</td><td class="ctr2" id="m3">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/index.source.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/index.source.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.mojos/index.source.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>org.apache.commons.release.plugin.mojos</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.html" class="el_class">Classes</a><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <span class="el_package">org.apache.commons.release.plugin.mojos</span></div><h1>org.apache.commons.rel ease.plugin.mojos</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" oncli ck="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">553 of 1,704</td><td class="ctr2">67%</td><td class="bar">31 of 88</td><td class="ctr2">64%</td><td class="ctr1">26</td><td class="ctr2">70</td><td class="ctr1">96</td><td class="ctr2">334</td><td class="ctr1">0</td><td class="ctr2">26</td><td class="ctr1">0</td><td class="ctr2">4</td></tr></tfoot><tbody><tr><td id="a1"><a href="CommonsDistributionStagingMojo.java.html" class="el_source">CommonsDistributionStagingMojo.java</a></td><td class="bar" id="b0"><img src="../jacoco-resources/redbar.gif" width="37" height="10" title="268" alt="268"/><img src="../jacoco-resources/greenbar.gif" width="82" height="10" title="580" alt="580"/></td><td class="ctr2" id="c2">68%</td><td class="bar" id="d0"><img src="../jacoco-resources/redbar.gif" width="43" height="10" title="13" alt="13"/><img src="../jacoco-resources/greenbar.gif" width="76" height="10" title="23" alt="23"/></td><td class="ctr2" id="e2">63%</t d><td class="ctr1" id="f0">11</td><td class="ctr2" id="g0">28</td><td class="ctr1" id="h0">40</td><td class="ctr2" id="i0">152</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">10</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a3"><a href="CommonsStagingCleanupMojo.java.html" class="el_source">CommonsStagingCleanupMojo.java</a></td><td class="bar" id="b1"><img src="../jacoco-resources/redbar.gif" width="20" height="10" title="148" alt="148"/><img src="../jacoco-resources/greenbar.gif" width="12" height="10" title="90" alt="90"/></td><td class="ctr2" id="c3">37%</td><td class="bar" id="d1"><img src="../jacoco-resources/redbar.gif" width="36" height="10" title="11" alt="11"/><img src="../jacoco-resources/greenbar.gif" width="16" height="10" title="5" alt="5"/></td><td class="ctr2" id="e3">31%</td><td class="ctr1" id="f1">8</td><td class="ctr2" id="g3">10</td><td class="ctr1" id="h1">26</td><td class="ctr2" id="i2">45</td><td class="ctr1" i d="j1">0</td><td class="ctr2" id="k3">2</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a0"><a href="CommonsDistributionDetachmentMojo.java.html" class="el_source">CommonsDistributionDetachmentMojo.java</a></td><td class="bar" id="b2"><img src="../jacoco-resources/redbar.gif" width="13" height="10" title="95" alt="95"/><img src="../jacoco-resources/greenbar.gif" width="46" height="10" title="327" alt="327"/></td><td class="ctr2" id="c1">77%</td><td class="bar" id="d3"><img src="../jacoco-resources/redbar.gif" width="10" height="10" title="3" alt="3"/><img src="../jacoco-resources/greenbar.gif" width="56" height="10" title="17" alt="17"/></td><td class="ctr2" id="e0">85%</td><td class="ctr1" id="f3">3</td><td class="ctr2" id="g1">19</td><td class="ctr1" id="h2">21</td><td class="ctr2" id="i1">93</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k1">9</td><td class="ctr1" id="l2">0</td><td class="ctr2" id="m2">1</td></tr><tr><td id="a2"><a href ="CommonsSiteCompressionMojo.java.html" class="el_source">CommonsSiteCompressionMojo.java</a></td><td class="bar" id="b3"><img src="../jacoco-resources/redbar.gif" width="5" height="10" title="42" alt="42"/><img src="../jacoco-resources/greenbar.gif" width="21" height="10" title="154" alt="154"/></td><td class="ctr2" id="c0">78%</td><td class="bar" id="d2"><img src="../jacoco-resources/redbar.gif" width="13" height="10" title="4" alt="4"/><img src="../jacoco-resources/greenbar.gif" width="40" height="10" title="12" alt="12"/></td><td class="ctr2" id="e1">75%</td><td class="ctr1" id="f2">4</td><td class="ctr2" id="g2">13</td><td class="ctr1" id="h3">9</td><td class="ctr2" id="i3">44</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k2">5</td><td class="ctr1" id="l3">0</td><td class="ctr2" id="m3">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file Added: dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.velocity/HeaderHtmlVelocityDelegate$HeaderHtmlVelocityDelegateBuilder.html ============================================================================== --- dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.velocity/HeaderHtmlVelocityDelegate$HeaderHtmlVelocityDelegateBuilder.html (added) +++ dev/commons/release-plugin/1.8.3-RC1/site/jacoco/org.apache.commons.release.plugin.velocity/HeaderHtmlVelocityDelegate$HeaderHtmlVelocityDelegateBuilder.html Sun Nov 3 20:07:40 2024 @@ -0,0 +1 @@ +<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>HeaderHtmlVelocityDelegate.HeaderHtmlVelocityDelegateBuilder</title><script type="text/javascript" src="../jacoco-resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Apache Commons Release Plugin</a> > <a href="index.html" class="el_package">org.apache.commons.release.plugin.velocity</a> > <span class="el_class">HeaderHtmlVelocityDelegate.Header HtmlVelocityDelegateBuilder</span></div><h1>HeaderHtmlVelocityDelegate.HeaderHtmlVelocityDelegateBuilder</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><t r><td>Total</td><td class="bar">0 of 5</td><td class="ctr2">100%</td><td class="bar">0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">0</td><td class="ctr2">1</td><td class="ctr1">0</td><td class="ctr2">1</td><td class="ctr1">0</td><td class="ctr2">1</td></tr></tfoot><tbody><tr><td id="a0"><a href="HeaderHtmlVelocityDelegate.java.html#L84" class="el_method">build()</a></td><td class="bar" id="b0"><img src="../jacoco-resources/greenbar.gif" width="120" height="10" title="5" alt="5"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">1</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.12.202403310830</span></div></body></html> \ No newline at end of file