You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/01/18 09:28:07 UTC
svn commit: r125467 - /maven/maven-1/plugins/trunk/test/xdocs/faq.fml
Author: brett
Date: Tue Jan 18 00:28:03 2005
New Revision: 125467
URL: http://svn.apache.org/viewcvs?view=rev&rev=125467
Log:
add FAQ
Added:
maven/maven-1/plugins/trunk/test/xdocs/faq.fml
Added: maven/maven-1/plugins/trunk/test/xdocs/faq.fml
Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/test/xdocs/faq.fml?view=auto&rev=125467
==============================================================================
--- (empty file)
+++ maven/maven-1/plugins/trunk/test/xdocs/faq.fml Tue Jan 18 00:28:03 2005
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+ -->
+
+<faqs title="Frequently Asked Questions">
+
+ <part id="general">
+ <title>General</title>
+
+ <faq id="how-to-mail">
+ <question>
+ How do I email a test report?
+ </question>
+ <answer>
+ <p>
+ The following sample code will email a test report if there are any failures:
+ </p>
+ <source><![CDATA[<postGoal name="maven-junit-report-plugin:report">
+ <j:if test="${maven.test.failure}">
+ <j:set var="mailReport" value="${test.mail.report}" />
+ <j:if test="${mailReport}">
+ <attainGoal name="mail-test-report" />
+ </j:if>
+ </j:if>
+</postGoal>
+
+<goal name="mail-test-report">
+ ${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
+ <ant:style in="${maven.build.dir}/TESTS-TestSuites.xml" out="${maven.build.dir}/junit-report-mail.html" style="${basedir}/overview-summary.xsl" />
+
+ <ant:tstamp/>
+ <ant:mail messageMimeType="text/html" messageFile="${maven.build.dir}/junit-report-mail.html"
+ subject="[BUILD] JUnit Test Results for ${pom.artifactId}: ${TODAY}" tolist="${pom.build.nagEmailAddress}
+">
+ <ant:from name="Build Master" address="someone@nowhere.com.au" />
+ </ant:mail>
+</goal>]]></source>
+ <p>
+ Include this in your <code>maven.xml</code> file, and set the property <code>test.mail.report</code>
+ to <code>true</code> for the users that you want to send the mail from (typically just you continuous
+ integration environment).
+ </p>
+ <p>
+ Note that you have to include Xalan in your dependencies for this particular example (see the main
+ <a href="http://maven.apache.org/faq.html">Maven FAQ</a> for more information), and provide the
+ <code>overview-summary.xsl</code> file in your project's base directory. An example one is
+ distributed with Ant in <code>etc/junit-noframes.xsl</code>.
+ </p>
+ <p>
+ If you want to receive successful reports, exclude the <code><![CDATA[<j:if test="${maven.test.failure}">]]></code> condition.
+ </p>
+ </answer>
+ </faq>
+ </part>
+</faqs>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org