List of usage examples for org.apache.maven.reporting MavenReportException MavenReportException
public MavenReportException(String msg)
From source file:com.adobe.ac.maven.ncss.NcssReportMojo.java
License:Apache License
/** * @see org.apache.maven.reporting.MavenReport#execute(java.util.Locale) *//*from w ww .j av a2 s.c o m*/ public void executeReport(final Locale locale) throws MavenReportException { if (getLog().isDebugEnabled()) { getLog().debug("NcssReportMojo.executeReport()"); } if (!canGenerateReport()) { throw new MavenReportException("Cannot generate report "); } if (canGenerateSingleReport()) { generateSingleReport(locale); } if (canGenerateAggregateReport()) { generateAggregateReport(locale); } }
From source file:com.adobe.ac.maven.ncss.NcssReportMojo.java
License:Apache License
private void generateSingleReport(final Locale locale) throws MavenReportException { if (getLog().isDebugEnabled()) { getLog().debug("Calling NCSSExecuter with src : " + sourceDirectory); getLog().debug("Calling NCSSExecuter with output : " + buildOutputFile()); getLog().debug("Calling NCSSExecuter with includes : " + includes); getLog().debug("Calling NCSSExecuter with excludes : " + excludes); }//from w w w .j a v a 2 s .c o m // run javaNCss and produce an temp xml file NcssExecuter ncssExecuter; if (isIncludeExcludeUsed()) { ncssExecuter = new NcssExecuter(scanForSources(), buildOutputFile()); } else { ncssExecuter = new NcssExecuter(sourceDirectory, buildOutputFile()); } ncssExecuter.execute(); if (!isTempReportGenerated()) { throw new MavenReportException("Can't process temp ncss xml file."); } // parse the freshly generated file and write the report final NcssReportGenerator reportGenerator = new NcssReportGenerator(getSink(), getBundle(locale), getLog()); reportGenerator.doReport(loadDocument(), lineThreshold); }
From source file:com.adobe.ac.pmd.maven.AbstractFlexPmdMojo.java
License:Apache License
protected void onXmlReportExecuted(final FlexPmdViolations violations, final Locale locale) throws MavenReportException { if (failOnError) { final String message = PmdEngineUtils.findFirstViolationError(violations); if (message.length() > 0) { throw new MavenReportException(message); }/* w w w . ja v a 2 s.c o m*/ } if (failOnRuleViolation && !violations.getViolations().isEmpty()) { throw new MavenReportException("At least one violation has been found"); } }
From source file:com.adobe.ac.pmd.metrics.maven.FlexMetricsReportMojo.java
License:Apache License
private void generateSingleReport() throws MavenReportException, DocumentException, IOException { if (getLog().isDebugEnabled()) { getLog().debug("Calling NCSSExecuter with src : " + sourceDirectory); getLog().debug("Calling NCSSExecuter with output : " + buildOutputFile()); }/*from ww w . ja va 2 s.com*/ // run javaNCss and produce an temp xml file new NcssExecuter(sourceDirectory, buildOutputFile(), mxmlFactor).execute(); if (!isTempReportGenerated()) { throw new MavenReportException("Can't process temp ncss xml file."); } // parse the freshly generated file and write the report final NcssReportGenerator reportGenerator = new NcssReportGenerator(getSink(), getBundle(), getLog()); reportGenerator.doReport(loadDocument(), lineThreshold); }
From source file:com.agilejava.blammo.mojo.BlammoReportMojo.java
License:Open Source License
protected void executeReport(Locale arg0) throws MavenReportException { List loggers = null;/*from w w w . j a va 2s . c o m*/ try { loggers = new BlammoParser(messageIdPrefix, messageIdOffset).parse(javaSourcesDir); } catch (BlammoParserException bpe) { throw new MavenReportException( bpe.getMessage() + ": line " + bpe.getLineNumber() + " in " + bpe.getSourceFile().getFile()); } generate(loggers, getSink()); }
From source file:com.anite.maven.plugin.hivedoc.HivedocReport.java
License:Apache License
public void generate(Sink sink, Locale locale) throws MavenReportException { try {/* w ww . ja va2 s . co m*/ execute(); } catch (MojoExecutionException e) { throw new MavenReportException("It broke"); } catch (MojoFailureException e) { throw new MavenReportException("It broke"); } }
From source file:com.butlerhq.extdoc.ExtDocReport.java
License:Apache License
@Override public void generate(Sink sink, Locale locale) throws MavenReportException { if (project != null || source != null && source.length > 0) { Thread currentThread = Thread.currentThread(); ClassLoader originalClassLoader = currentThread.getContextClassLoader(); try {/*from ww w .jav a 2s.com*/ // workaround for jaxb issue (extdoc uses a call that depends on the thread's classloader) currentThread.setContextClassLoader(FileProcessor.class.getClassLoader()); FileProcessor processor = new FileProcessor(); if (quiet) { processor.setQuiet(); } else if (verbose) { processor.setVerbose(); } processor.process(project, source); processor.saveToFolder(output.getPath(), template); } finally { Thread.currentThread().setContextClassLoader(originalClassLoader); } } else { throw new MavenReportException("The extdoc plugin requires project OR source parameters."); } }
From source file:com.github.lucapino.jira.CreateReportMojo.java
License:Apache License
@Override public void executeReport(Locale locale) throws MavenReportException { // Validate parameters List<Integer> columnIds = IssuesReportHelper.getColumnIds(columnNames, JIRA_COLUMNS); if (columnIds.isEmpty()) { // This can happen if the user has configured column names and they are all invalid throw new MavenReportException( "jira-maven-plugin: None of the configured columnNames '" + columnNames + "' are valid."); }//from w w w .j a v a 2s .c o m try { // Download issues IssuesDownloader issueDownloader = new IssuesDownloader(); configureIssueDownloader(issueDownloader); List<JiraIssue> issueList = issueDownloader.getIssueList(); // Generate the report IssuesReportGenerator report = new IssuesReportGenerator(IssuesReportHelper.toIntArray(columnIds)); if (issueList.isEmpty()) { report.doGenerateEmptyReport(getBundle(locale), getSink()); } else { report.doGenerateReport(getBundle(locale), getSink(), issueList); } } catch (MojoFailureException e) { getLog().warn(e); } }
From source file:com.indoqa.maven.wadldoc.AbstractWadlDocumentationMojo.java
License:Apache License
private void copyStylesheet() throws MavenReportException { if (this.stylesheet != null) { if (!this.stylesheet.exists()) { throw new MavenReportException("The referred stylesheet " + this.stylesheet + " doesn't exist."); }// ww w. j av a 2 s .c om try { FileUtils.copyFile(this.stylesheet, new File(this.outputDirectory, this.stylesheet.getName())); } catch (IOException e) { throw new MavenReportException("Can't copy stylesheet " + this.stylesheet, e); } } }
From source file:com.obomprogramador.tools.jqana.mavenplugin.JqanaMojo.java
License:Apache License
@Override protected void executeReport(Locale locale) throws MavenReportException { try {// ww w . j av a 2 s.co m this.context = new Context(); } catch (Exception e) { getLog().error("******************>>>>> Exception initializing context: " + e.getMessage()); throw new MavenReportException(e.getMessage()); } DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date date = new Date(); String reportDate = df.format(date); Sink sink = getSink(); sink.head(); sink.title(); sink.text(this.getName(locale)); sink.title_(); sink.head_(); sink.body(); createReportBegin(sink, reportDate, locale); reportPackageMetrics(sink, locale); sink.lineBreak(); sink.link(getBundle(locale).getString("jqana.link")); sink.text(getBundle(locale).getString("jqana.url")); sink.link_(); sink.section1_(); sink.body_(); sink.flush(); sink.close(); }