You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2015/11/28 18:02:14 UTC
svn commit: r1716997 - in /maven/sandbox/trunk/dist-tools/dist-tool-plugin:
./ src/main/java/org/apache/maven/dist/tools/ src/site/ src/site/markdown/
Author: hboutemy
Date: Sat Nov 28 17:02:14 2015
New Revision: 1716997
URL: http://svn.apache.org/viewvc?rev=1716997&view=rev
Log:
added Check Errors report, to focus only on issues
Added:
maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java (with props)
Modified:
maven/sandbox/trunk/dist-tools/dist-tool-plugin/pom.xml
maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DummyFailureMojo.java
maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/markdown/index.md
maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/site.xml
Modified: maven/sandbox/trunk/dist-tools/dist-tool-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/dist-tools/dist-tool-plugin/pom.xml?rev=1716997&r1=1716996&r2=1716997&view=diff
==============================================================================
--- maven/sandbox/trunk/dist-tools/dist-tool-plugin/pom.xml (original)
+++ maven/sandbox/trunk/dist-tools/dist-tool-plugin/pom.xml Sat Nov 28 17:02:14 2015
@@ -233,6 +233,7 @@
<report>check-site</report>
<report>check-source-release</report>
<report>check-index-page</report>
+ <report>check-errors</report>
<report>list-plugins-prerequisites</report>
</reports>
</reportSet>
Added: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java?rev=1716997&view=auto
==============================================================================
--- maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java (added)
+++ maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java Sat Nov 28 17:02:14 2015
@@ -0,0 +1,150 @@
+package org.apache.maven.dist.tools;
+
+/*
+ * 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.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Locale;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ *
+ * @author skygo
+ */
+@Mojo( name = "check-errors", requiresProject = false )
+public class DistCheckErrorsMojo
+ extends AbstractDistCheckMojo
+{
+ private static final String[] FAILURES_FILENAMES = { DistCheckSourceReleaseMojo.FAILURES_FILENAME,
+ DistCheckSiteMojo.FAILURES_FILENAME, DistCheckIndexPageMojo.FAILURES_FILENAME };
+
+ private static final String EOL = System.getProperty( "line.separator" );
+
+ @Override
+ boolean isIndexPageCheck()
+ {
+ return false;
+ }
+
+ boolean isDummyFailure()
+ {
+ return false;
+ }
+
+ private boolean checkError( String failuresFilename )
+ throws MavenReportException
+ {
+ File failureFile = new File( failuresDirectory, failuresFilename );
+
+ try
+ {
+ if ( failureFile.exists() )
+ {
+ String content = FileUtils.fileRead( failureFile );
+
+ if ( isDummyFailure() )
+ {
+ getLog().error( failuresFilename + " error log not empty:" + EOL + content );
+ }
+ else
+ {
+ String failure = failuresFilename.substring( 0, failuresFilename.length() - 4 );
+ getSink().section2();
+ getSink().sectionTitle2();
+ getSink().link( "dist-tool-" + failure + ".html" );
+ getSink().text( failure );
+ getSink().link_();
+ getSink().sectionTitle2_();
+ getSink().verbatim( true );
+ getSink().rawText( content );
+ getSink().verbatim_();
+ getSink().section2_();
+ }
+ }
+
+ return failureFile.exists();
+ }
+ catch ( IOException ioe )
+ {
+ throw new MavenReportException( "Cannot read " + failureFile, ioe );
+ }
+ }
+
+ @Override
+ protected void executeReport( Locale locale )
+ throws MavenReportException
+ {
+ boolean failure = false;
+ // if failures log file is present, throw exception to fail build
+ for ( String failuresFilename : FAILURES_FILENAMES )
+ {
+ failure |= checkError( failuresFilename );
+ }
+
+ if ( failure )
+ {
+ if ( isDummyFailure() )
+ {
+ throw new MavenReportException( "Dist Tool> Checks found inconsistencies in some released "
+ + "artifacts, see https://builds.apache.org/job/dist-tool-plugin/site/dist-tool-check-errors.html "
+ + "for more information" );
+ }
+ }
+ else
+ {
+ getSink().paragraph();
+ getSink().text( "No issue found." );
+ getSink().paragraph_();
+ }
+ }
+
+ protected String getFailuresFilename()
+ {
+ return "dummy";
+ }
+
+ @Override
+ public String getOutputName()
+ {
+ return "dist-tool-check-errors";
+ }
+
+ @Override
+ public String getName( Locale locale )
+ {
+ return "Dist Tool> Check Errors";
+ }
+
+ @Override
+ public String getDescription( Locale locale )
+ {
+ return "Dist Tool report to display inconsistencies found by any check report";
+ }
+
+ @Override
+ protected void checkArtifact( ConfigurationLineInfo request, String repoBase )
+ throws MojoExecutionException
+ {
+ }
+}
Propchange: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DistCheckErrorsMojo.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DummyFailureMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DummyFailureMojo.java?rev=1716997&r1=1716996&r2=1716997&view=diff
==============================================================================
--- maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DummyFailureMojo.java (original)
+++ maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/main/java/org/apache/maven/dist/tools/DummyFailureMojo.java Sat Nov 28 17:02:14 2015
@@ -19,14 +19,9 @@ package org.apache.maven.dist.tools;
* under the License.
*/
-import java.io.File;
-import java.io.IOException;
import java.util.Locale;
-import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.plexus.util.FileUtils;
/**
*
@@ -34,55 +29,12 @@ import org.codehaus.plexus.util.FileUtil
*/
@Mojo( name = "failure-report", requiresProject = false )
public class DummyFailureMojo
- extends AbstractDistCheckMojo
+ extends DistCheckErrorsMojo
{
- private static final String[] FAILURES_FILENAMES = { DistCheckSourceReleaseMojo.FAILURES_FILENAME,
- DistCheckSiteMojo.FAILURES_FILENAME, DistCheckIndexPageMojo.FAILURES_FILENAME };
-
- private static final String EOL = System.getProperty( "line.separator" );
-
- @Override
- boolean isIndexPageCheck()
- {
- return false;
- }
-
- private boolean checkFailure( String failuresFilename )
- throws MavenReportException
- {
- File failureFile = new File( failuresDirectory, failuresFilename );
-
- try
- {
- if ( failureFile.exists() )
- {
- getLog().error( failuresFilename + " error log not empty:" + EOL + FileUtils.fileRead( failureFile ) );
- }
-
- return failureFile.exists();
- }
- catch ( IOException ioe )
- {
- throw new MavenReportException( "Cannot read " + failureFile, ioe );
- }
- }
-
@Override
- protected void executeReport( Locale locale )
- throws MavenReportException
+ boolean isDummyFailure()
{
- boolean failure = false;
- // if failures log file is present, throw exception to fail build
- for ( String failuresFilename : FAILURES_FILENAMES )
- {
- failure |= checkFailure( failuresFilename );
- }
-
- if ( failure )
- {
- throw new MavenReportException( "Dist tools check reports found inconsistencies in some released "
- + "artifacts, see https://builds.apache.org/job/dist-tool-plugin/site/ for more information" );
- }
+ return true;
}
protected String getFailuresFilename()
@@ -107,10 +59,4 @@ public class DummyFailureMojo
{
return "Dist Tool report to fail the build in case of inconsistency found by any check reports";
}
-
- @Override
- protected void checkArtifact( ConfigurationLineInfo request, String repoBase )
- throws MojoExecutionException
- {
- }
}
Modified: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/markdown/index.md
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/markdown/index.md?rev=1716997&r1=1716996&r2=1716997&view=diff
==============================================================================
--- maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/markdown/index.md (original)
+++ maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/markdown/index.md Sat Nov 28 17:02:14 2015
@@ -22,13 +22,15 @@ About dist-tool-plugin
The dist-tool-plugin checks that [Maven release process][6] has been fully applied across every artifact, as listed in [configuration file][4].
-Results are displayed in 3 reports:
+Results are displayed in 4 reports:
* [Check Source Release][2] report, for checks about artifacts [source release publication][5],
* [Check Sites][1] report, for checks about documentation sites associated to artifacts,
-* [Check Index page][3] report, for checks about index pages.
+* [Check Index page][3] report, for checks about index pages,
+
+* [Check Errors][8] report, to display errors found in previous checks.
In addition, dist-tool-plugin provides report for some interesting information about Maven artifacts:
@@ -44,4 +46,4 @@ in other context, it would require more
[5]: http://maven.apache.org/developers/release/maven-project-release-procedure.html#Copy_the_source_release_to_the_Apache_Distribution_Area
[6]: http://maven.apache.org/developers/release/releasing.html
[7]: ./dist-tool-prerequisites.html
-
+[8]: ./dist-tool-check-errors.html
Modified: maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/site.xml?rev=1716997&r1=1716996&r2=1716997&view=diff
==============================================================================
--- maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/site.xml (original)
+++ maven/sandbox/trunk/dist-tools/dist-tool-plugin/src/site/site.xml Sat Nov 28 17:02:14 2015
@@ -32,6 +32,7 @@ under the License.
<item name="Check Source Release" href="dist-tool-check-source-release.html" />
<item name="Check Sites" href="dist-tool-check-site.html" />
<item name="Check Index Pages" href="dist-tool-check-index-page.html" />
+ <item name="Check Errors" href="dist-tool-check-errors.html" />
</menu>
<menu name="Dist Tool Informations">
<item name="List Plugins Prerequisites" href="dist-tool-prerequisites.html" />