Modified: maven/website/content/guides/mini/guide-snippet-macro.html ============================================================================== --- maven/website/content/guides/mini/guide-snippet-macro.html (original) +++ maven/website/content/guides/mini/guide-snippet-macro.html Sun May 12 07:42:36 2024 @@ -2,17 +2,17 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-snippet-macro.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-snippet-macro.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Wendy Smoak" /> <meta name="date" content="2014-08-20" /> - <title>Maven</title> + <title>Maven â Guide to the Snippet Macro</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -39,10 +39,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -50,9 +48,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-snippet-macro.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to the Snippet Macro <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-snippet-macro.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -150,24 +147,24 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Guide_to_the_Snippet_Macro"></a> +<section> <h1>Guide to the Snippet Macro</h1> <p>When generating your project website with Maven, you have the option of dynamically including <i>snippet</i>s of source code in your pages.</p> <p>A <i>snippet</i> is a section of a source code file that is surrounded by specially formatted comments.</p> <p>This functionality is inspired by the <a class="externalLink" href="http://www.atlassian.com/software/confluence/">Confluence</a> snippet macro, and is provided by the Maven Doxia project by way of the Maven Site Plugin.</p> <p>To include snippets of source code in your documentation, first add comments in the source document surrounding the lines you want to include, and then refer to the snippet by its id in the documentation file. Each snippet must be assigned an id, and the id must be unique within the source document. The id parameter is not required if you want to include the entire file.</p> <p>Following are examples of snippets in various source documents, as well as the corresponding macros in the APT documentation format.</p> -<p>See the Doxia <a href="/doxia/macros/index.html#Snippet_Macro">Macros Guide</a> for more information and examples.</p><section><a id="Snippets_in_Sources"></a> -<h2>Snippets in Sources</h2><section><a id="Java"></a> +<p>See the Doxia <a href="/doxia/macros/index.html#Snippet_Macro">Macros Guide</a> for more information and examples.</p><section> +<h2>Snippets in Sources</h2><section> <h3>Java</h3> -<pre><code> // START SNIPPET: snip-id +<div class="verbatim source"><pre class="prettyprint linenums"> // START SNIPPET: snip-id public static void main( String[] args ) { System.out.println( "Hello World!" ); } - // END SNIPPET: snip-id</code></pre></section><section><a id="XML"></a> + // END SNIPPET: snip-id</pre></div></section><section> <h3>XML</h3> -<pre><code> <!-- START SNIPPET: snip-id --> +<div class="verbatim source"><pre class="prettyprint linenums"> <!-- START SNIPPET: snip-id --> <navigation-rule> <from-view-id>/logon.jsp</from-view-id> <navigation-case> @@ -175,22 +172,22 @@ <to-view-id>/mainMenu.jsp</to-view-id> </navigation-case> </navigation-rule> - <!-- END SNIPPET: snip-id --></code></pre></section><section><a id="JSP"></a> + <!-- END SNIPPET: snip-id --></pre></div></section><section> <h3>JSP</h3> -<pre><code> <%-- START SNIPPET: snip-id --%> +<div class="verbatim source"><pre class="prettyprint linenums"> <%-- START SNIPPET: snip-id --%> <ul> <li><a href="newPerson!input.action">Create</a> a new person</li> <li><a href="listPeople.action">List</a> all people</li> </ul> - <%-- END SNIPPET: snip-id --%></code></pre></section></section><section><a id="Snippets_in_Documentation"></a> -<h2>Snippets in Documentation</h2><section><a id="APT"></a> + <%-- END SNIPPET: snip-id --%></pre></div></section></section><section> +<h2>Snippets in Documentation</h2><section> <h3>APT</h3> -<pre><code> %{snippet|id=snip-id|url=http://svn.example.com/path/to/Sample.java} +<div class="verbatim source"><pre class="prettyprint linenums"> %{snippet|id=snip-id|url=http://svn.example.com/path/to/Sample.java} - %{snippet|id=snip-id|url=file:///path/to/Sample.java}</code></pre> + %{snippet|id=snip-id|url=file:///path/to/Sample.java}</pre></div> <p>As of doxia-core version 1.0-alpha-9, a 'file' parameter is also available. If a full path is not specified, the location is assumed to be relative to ${project.basedir}.</p> -<pre><code> ~~ Since doxia-core 1.0-alpha-9 - %{snippet|id=abc|file=src/main/webapp/index.jsp}</code></pre> +<div class="verbatim source"><pre class="prettyprint linenums"> ~~ Since doxia-core 1.0-alpha-9 + %{snippet|id=abc|file=src/main/webapp/index.jsp}</pre></div> <ul> <li>Macros in apt <b>must not</b> be indented.</li> <li>Exactly one of <code>url</code> or <code>file</code> <b>must</b> be specified.</li></ul></section></section></section>
Modified: maven/website/content/guides/mini/guide-using-ant.html ============================================================================== --- maven/website/content/guides/mini/guide-using-ant.html (original) +++ maven/website/content/guides/mini/guide-using-ant.html Sun May 12 07:42:36 2024 @@ -2,17 +2,17 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-using-ant.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-using-ant.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Jason van Zyl" /> <meta name="date" content="2005-10-12" /> - <title>Maven</title> + <title>Maven â Guide to using Ant with Maven</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -39,10 +39,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -50,9 +48,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-ant.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to using Ant with Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-ant.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -163,10 +160,10 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Guide_to_using_Ant_with_Maven"></a> +<section> <h1>Guide to using Ant with Maven</h1> <p>The example above illustrates how to bind an ant script to a lifecycle phase. You can add a script to each lifecycle phase, by duplicating the <i>execution/</i> section and specifying a new phase.</p> -<pre><code> +<div class="verbatim source"><pre class="prettyprint linenums"> <project> <modelVersion>4.0.0</modelVersion> <artifactId>my-test-app</artifactId> @@ -200,9 +197,9 @@ </plugins> </build> </project> -</code></pre> +</pre></div> <p>So a concrete example would be something like the following:</p> -<pre><code> +<div class="verbatim source"><pre class="prettyprint linenums"> <project> <modelVersion>4.0.0</modelVersion> <artifactId>my-test-app</artifactId> @@ -235,7 +232,7 @@ </plugins> </build> </project> -</code></pre></section> +</pre></div></section> </main> </div> </div> Modified: maven/website/content/guides/mini/guide-using-extensions.html ============================================================================== --- maven/website/content/guides/mini/guide-using-extensions.html (original) +++ maven/website/content/guides/mini/guide-using-extensions.html Sun May 12 07:42:36 2024 @@ -2,18 +2,18 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-using-extensions.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-using-extensions.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Jason van Zyl" /> <meta name="author" content="Konrad Windszus" /> <meta name="date" content="2022-11-16" /> - <title>Maven</title> + <title>Maven â Guide to using Extensions</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -40,10 +40,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -51,9 +49,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-extensions.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to using Extensions <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-extensions.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -164,23 +161,23 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Using_Extensions"></a> +<section> <h1>Using Extensions</h1> <p>Extensions are a way to add classes to either the <a href="./guide-maven-classloading.html#Core_Classloader">Core Classloader</a> (Core Extensions) or the <a href="./guide-maven-classloading.html#Project_Classloaders">Project Classloader</a> (Build Extensions). This is necessary for adjusting Maven in a way that affects more than just one plug-in.</p> <p>The mechanism allows extensions to either replace default <a class="externalLink" href="https://www.eclipse.org/sisu/">Sisu components</a> with custom ones or add new components which are used at run time. In addition one could also expose additional packages from the Core Classloader.</p> -<p>Extensions are typically used to enable <a href="../../wagon/wagon-providers/">Wagon providers</a>, used for the transport of artifact between repositories, and plug-ins which <a href="../../examples/maven-3-lifecycle-extensions.html">provide lifecycle enhancements</a>.</p><section><a id="Loading_Extensions"></a> +<p>Extensions are typically used to enable <a href="../../wagon/wagon-providers/">Wagon providers</a>, used for the transport of artifact between repositories, and plug-ins which <a href="../../examples/maven-3-lifecycle-extensions.html">provide lifecycle enhancements</a>.</p><section> <h2>Loading Extensions</h2> -<p>There are different means of loading extensions depending on the type. There are <i>core extensions</i> which are loaded <b>early</b> and build extensions which are loaded <b>late</b>. Some extensions require early loading as they fundamentally change Maven behaviour. An extension's documentation should indicate whether it provides a core or a build extension.</p><section><a id="Core_Extension"></a> +<p>There are different means of loading extensions depending on the type. There are <i>core extensions</i> which are loaded <b>early</b> and build extensions which are loaded <b>late</b>. Some extensions require early loading as they fundamentally change Maven behaviour. An extension's documentation should indicate whether it provides a core or a build extension.</p><section> <h3>Core Extension</h3> <ul> <li>Registered via extension jar in <code>${maven.home}/lib/ext</code></li> <li>Registered via CLI argument <code>mvn -Dmaven.ext.class.path=extension.jar</code></li> -<li>Registered via <a href="../../configure.html#mvn-extensions-xml-file"><code>.mvn/extensions.xml</code> file</a></li></ul></section><section><a id="Build_Extension"></a> +<li>Registered via <a href="../../configure.html#mvn-extensions-xml-file"><code>.mvn/extensions.xml</code> file</a></li></ul></section><section> <h3>Build Extension</h3> <ul> <li>Registered via <a href="../../pom.html#Plugins"><code>project->build->plugins->plugin</code></a> with element <code>extensions</code> being set to <code>true</code>. This is useful for regular plug-ins carrying some extensions. <p>Example:</p> -<pre><code> +<div class="verbatim source"><pre class="prettyprint linenums"> <project> ... <build> @@ -197,10 +194,10 @@ </build> ... </project> -</code></pre></li> +</pre></div></li> <li>Registered as build extension in <a href="../../pom.html#Extensions"><code>project->build->extensions->extension</code></a> <p>Example:</p> -<pre><code> +<div class="verbatim source"><pre class="prettyprint linenums"> <project> ... <build> @@ -214,7 +211,7 @@ </build> ... </project> -</code></pre></li></ul></section></section></section> +</pre></div></li></ul></section></section></section> </main> </div> </div> Modified: maven/website/content/guides/mini/guide-using-modello.html ============================================================================== --- maven/website/content/guides/mini/guide-using-modello.html (original) +++ maven/website/content/guides/mini/guide-using-modello.html Sun May 12 07:42:36 2024 @@ -2,18 +2,18 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-using-modello.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-using-modello.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Jason van Zyl" /> <meta name="author" content="Hervé Boutemy" /> <meta name="date" content="2009-03-01" /> - <title>Maven</title> + <title>Maven â Guide to using Modello</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -40,10 +40,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -51,9 +49,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-modello.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to using Modello <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-modello.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -164,7 +161,7 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Guide_to_using_Modello"></a> +<section> <h1>Guide to using Modello</h1> <p><a class="externalLink" href="https://codehaus-plexus.github.io/modello/">Modello</a> is a tool for generating resources from a simple model. From a <a class="externalLink" href="https://codehaus-plexus.github.io/modello/modello.html">simple model</a> you can generate things like:</p> <ul> @@ -174,7 +171,7 @@ <li>Model documentation</li> <li>XSD</li></ul> <p>A typical modello model looks like the following:</p> -<pre><code><model xmlns="https://codehaus-plexus.github.io/MODELLO/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<div class="verbatim source"><pre class="prettyprint linenums"><model xmlns="https://codehaus-plexus.github.io/MODELLO/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://codehaus-plexus.github.io/MODELLO/1.8.0 https://codehaus-plexus.github.io/modello/xsd/modello-1.8.0.xsd" xml.namespace="https://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/${version}" xml.schemaLocation="http://maven.apache.org/xsd/archetype-descriptor-${version}.xsd"> @@ -397,9 +394,9 @@ </class> </classes> </model> -</code></pre> +</pre></div> <p>To utilize Modello, you would configure the <code>modello-maven-plugin</code> something like the following where you want to generate the Java sources for the model, the xpp3 serialization code and the xpp3 deserialization code (see <a class="externalLink" href="https://codehaus-plexus.github.io/modello/modello-plugins/modello-plugin-xpp3/">modello-plugin-xpp3</a> for more details):</p> -<pre><code> +<div class="verbatim source"><pre class="prettyprint linenums"> <project> ... <build> @@ -432,7 +429,7 @@ </build> ... </project> -</code></pre></section> +</pre></div></section> </main> </div> </div> Modified: maven/website/content/guides/mini/guide-using-one-source-directory.html ============================================================================== --- maven/website/content/guides/mini/guide-using-one-source-directory.html (original) +++ maven/website/content/guides/mini/guide-using-one-source-directory.html Sun May 12 07:42:36 2024 @@ -2,17 +2,17 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-using-one-source-directory.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-using-one-source-directory.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Brett Porter" /> <meta name="date" content="2005-12-05" /> - <title>Maven</title> + <title>Maven â Guide to Using Maven when You Can't Use the Conventions</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -39,10 +39,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -50,9 +48,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-one-source-directory.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to Using Maven when You Can't Use the Conventions <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-one-source-directory.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -131,32 +128,33 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Using_Maven_When_You_Can.27t_Use_the_Conventions"></a> +<section> <h1>Using Maven When You Can't Use the Conventions</h1> <p>There is a common misconception that Maven can't build a project that doesn't conform to certain directory structures or build practices. This often isn't the case. However, it is true that some Maven features or plugins (especially by third parties) may not work or work completely.</p> <p>This guide will help you set up Maven on your project when the directive from on high is to not change the existing layout, and detail some of the feature that you might miss when doing so.</p> -<p>Use this as a last resort. There are good reasons why the defaults are the way they are, and we strongly recommend you use them if you can. It encourages consistency and means one less thing you ever need to worry about when starting a new project. There are more interesting things to do than change your layout for the sake of it. Hopefully having used any of these techniques you find that Maven proves itself capable, you will reconsider restructuring to address these issues.></p><section><a id="Using_Multiple_Source_Directories"></a> +<p>Use this as a last resort. There are good reasons why the defaults are the way they are, and we strongly recommend you use them if you can. It encourages consistency and means one less thing you ever need to worry about when starting a new project. There are more interesting things to do than change your layout for the sake of it. Hopefully having used any of these techniques you find that Maven proves itself capable, you will reconsider restructuring to address these issues.></p><section> <h2>Using Multiple Source Directories</h2> -<p>This occurs when you are producing a single JAR (or other artifact), and have several source directories with classes you want to include.</p><section><a id="Why_isn.27t_this_recommended.3F"></a> +<p>This occurs when you are producing a single JAR (or other artifact), and have several source directories with classes you want to include.</p><section> <h3>Why isn't this recommended?</h3> -<p>...</p></section><section><a id="How_do_I_do_this.3F"></a> +<p>...</p></section><section> <h3>How do I do this?</h3> -<p>...</p></section><section><a id="What_are_the_limitations.3F"></a> +<p>...</p></section><section> <h3>What are the limitations?</h3> -<p>There should be no limitations in this approach. Maven natively supports multiple source directories for the purposes of generated sources.</p></section></section><section><a id="Producing_Multiple_Unique_JARs_from_a_Single_Source_Directory"></a> +<p>There should be no limitations in this approach. Maven natively supports multiple source directories for the purposes of generated sources.</p></section></section><section> <h2>Producing Multiple Unique JARs from a Single Source Directory</h2> -<p>As many people that complain about not being able to spread out their sources into multiple source directories seem to complain about not wanting to spread anything out, producing several unique artifacts from a single directory using includes and excludes.</p><section><a id="Why_isn.27t_this_recommended.3F_1"></a> +<p>As many people that complain about not being able to spread out their sources into multiple source directories seem to complain about not wanting to spread anything out, producing several unique artifacts from a single directory using includes and excludes.</p><section> <h3>Why isn't this recommended?</h3> <p>This practice can be confusing and risky.</p> <ul> <li>You may end up building two JARs that include the same classes - this indicates that the common functionality should have been abstracted into a separate dependency.</li> -<li>You may end up introducing a dependency between the two JARs that you didn't realise, and often a circular dependency. This indicates that the classes are in the wrong JAR, or perhaps that everything should just be a single JAR.</li></ul></section><section><a id="How_do_I_do_this.3F_1"></a> +<li>You may end up introducing a dependency between the two JARs that you didn't realise, and often a circular dependency. This indicates that the classes are in the wrong JAR, or perhaps that everything should just be a single JAR.</li></ul></section><section> <h3>How do I do this?</h3> <p>You still should adhere to producing one artifact per POM, but this requires having multiple POMs, and hence multiple subdirectories. The positive to this is that these introduced directories won't change the layout of existing code, and will establish a future layout should you decide to separate.</p> <p>Here is an example of setting it up when there is a project with two JARs produced: <code>core</code> and <code>module</code>.</p> <p>You might like to review the <a href="../getting-started/"> Getting Started Guide</a></p> <p>that demonstrates how this is normally done in Maven, as it is quite similar.</p> <p>Your directory will look something like this:</p> +<div class="verbatim"> <pre>/ +- pom.xml +- src/ @@ -165,9 +163,9 @@ +- core/ +- Core.java +- module/ - +- Module.java</pre> + +- Module.java</pre></div> <p>First, you set up your <code>pom.xml</code> at the top level not to produce anything, but to include the other modules we plan to create:</p> -<pre><code><project> +<div class="verbatim source"><pre class="prettyprint linenums"><project> <artifactId>my-parent</artifactId> <packaging>pom</packaging> ... @@ -175,9 +173,9 @@ <module>core</module> <module>module</module> </modules> -</project></code></pre> +</project></pre></div> <p>Next, the modules themselves are created. Here is the <code>core/pom.xml</code> file you should create. The one in the <code>module</code> subdirectory will be similar.</p> -<pre><code><project> +<div class="verbatim source"><pre class="prettyprint linenums"><project> <modelVersion>4.0.0</modelVersion> <parent> <groupId>my-groupId</groupId> @@ -200,9 +198,10 @@ </plugin> </plugins> </build> -</project></code></pre> +</project></pre></div> <p>In this example, the sources are found in the parent directory <code>../src/main/java</code>, and only Java files within a <code>core</code> package are included.</p> <p>The final result when building will look like this:</p> +<div class="verbatim"> <pre>/ +- pom.xml +- src/ @@ -219,9 +218,9 @@ +- module/ +- pom.xml +- target/ - +- my-module-1.0-SNAPSHOT.jar</pre></section><section><a id="What_are_the_limitations.3F_1"></a> + +- my-module-1.0-SNAPSHOT.jar</pre></div></section><section> <h3>What are the limitations?</h3> -<p>There is no universal inclusion/exclusion specification, so each plugin needs to be configured individually, and some might not have that capability. In particular, expect that site reports may include all sources, for example.</p></section></section><section><a id="Producing_Multiple_JARs_from_a_single_POM"></a> +<p>There is no universal inclusion/exclusion specification, so each plugin needs to be configured individually, and some might not have that capability. In particular, expect that site reports may include all sources, for example.</p></section></section><section> <h2>Producing Multiple JARs from a single POM</h2> <p>Source directories aside, sometimes people desire to produce multiple JARs from a single POM. Depending on your use case, Maven can support this.</p> <ul> Modified: maven/website/content/guides/mini/guide-using-toolchains.html ============================================================================== --- maven/website/content/guides/mini/guide-using-toolchains.html (original) +++ maven/website/content/guides/mini/guide-using-toolchains.html Sun May 12 07:42:36 2024 @@ -2,19 +2,19 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-using-toolchains.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-using-toolchains.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Maria Odea Ching" /> <meta name="author" content="Dennis Lundberg" /> <meta name="author" content="Karl Heinz Marbaise" /> <meta name="date" content="2016-03-08" /> - <title>Maven</title> + <title>Maven â Guide to Using Toolchains</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -41,10 +41,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -52,9 +50,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-toolchains.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to Using Toolchains <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-using-toolchains.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -165,11 +162,11 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Guide_to_Using_Toolchains"></a> -<h1>Guide to Using Toolchains</h1><section><a id="What_are_Toolchains.3F"></a> +<section> +<h1>Guide to Using Toolchains</h1><section> <h2>What are Toolchains?</h2> <p>Maven Toolchains provide a way for a project to specify the JDK (or other tools) used to build the project, without needing to configure this in each plugin or in every <code>pom.xml</code>.</p> -<p>When Maven Toolchains are used to specify the JDK, a project can be built by a specific version of the JDK independent of the one Maven is running with. This is similar to how JDK versions can be set in IDEs like IDEA, NetBeans and Eclipse.</p><section><a id="Prerequisites"></a> +<p>When Maven Toolchains are used to specify the JDK, a project can be built by a specific version of the JDK independent of the one Maven is running with. This is similar to how JDK versions can be set in IDEs like IDEA, NetBeans and Eclipse.</p><section> <h3>Prerequisites</h3> <p>For more details about Toolchains' design and implementation, see <a class="externalLink" href="https://cwiki.apache.org/confluence/display/MAVENOLD/Toolchains">Toolchains</a>.</p> <p>Below are some plugins which are toolchain-aware, with the toolchain-type used:</p> @@ -233,15 +230,15 @@ <td style="text-align: center;">protobuf</td> <td style="text-align: left;"><code><a class="externalLink" href="http://sergei-ivanov.github.io/maven-protoc-plugin/examples/protobuf-toolchain.html">maven-protoc-plugin</a></code></td> <td style="text-align: left;">0.3.2</td> -<td style="text-align: left;">github</td></tr></table></section></section><section><a id="Using_Toolchains_in_Your_Project"></a> +<td style="text-align: left;">github</td></tr></table></section></section><section> <h2>Using Toolchains in Your Project</h2> <p>There are two essential components that you need to configure in order to use toolchains:</p> -<ol style="list-style-type: decimal;"> +<ol style="list-style-type: decimal"> <li>the <code><a href="/plugins/maven-toolchains-plugin/">maven-toolchains-plugin</a></code> in your project POM,</li> <li>the <code><a href="/ref/current/maven-core/toolchains.html">toolchains.xml</a></code> file on the building machine.</li></ol> <p>The <code>maven-toolchains-plugin</code> is the one that sets the toolchain to be used by the toolchain-aware plugins in your project.</p> <p>For example, you want to use a different JDK version to build your project than the version used to run Maven, you can configure the version you want to use via this plugin as shown in the <code>pom.xml</code> below:</p> -<pre><code><plugins> +<div class="verbatim source"><pre class="prettyprint linenums"><plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -269,11 +266,11 @@ </configuration> </plugin> ... -</plugins></code></pre> +</plugins></pre></div> <p>As you can see in the example above, a JDK toolchain with <code><version></code> "1.8" and <code><vendor></code> "openjdk" is to be used. Now how does the plugin know where this JDK is installed? This is where the <code>toolchains.xml</code> file comes in.</p> <p>The <code>toolchains.xml</code> file (see below) is the configuration file where you set the installation paths of your toolchains. This file should be put in the <code>${user.home}/.m2</code> directory. When the <code>maven-toolchains-plugin</code> executes, it looks for the <code>toolchains.xml</code> file, reads it and looks for a toolchain matching the toolchains requirements configured in the plugin. In this example, that is a JDK toolchain with <code><version></code> "1.8" and <code><vendor></code> "openjdk". Once a match is found, the plugin then stores the toolchain to be used in the MavenSession. As you can see in the <code>toolchains.xml</code> below, there is indeed a JDK toolchain with <code><version></code> "1.8" and <code><vendor></code> "openjdk" configured. So when the <code>maven-compiler-plugin</code> configured in the <code>pom.xml</code> above executes, it sees that a JDK toolchain is set in the M avenSession and will use that toolchain (that would be the JDK installed at <code>/path/to/jdk/1.8</code> in this example) to compile the sources.</p> <p>Starting with <a href="/docs/3.3.1/release-notes.html">Maven 3.3.1</a> you can put the <code>toolchains.xml</code> file wherever you like by using the <code>--global-toolchains file</code> option, but it is recommended to locate it into <code>${user.home}/.m2/</code>. </p> -<pre><code><?xml version="1.0" encoding="UTF-8"?> +<div class="verbatim source"><pre class="prettyprint linenums"><?xml version="1.0" encoding="UTF-8"?> <toolchains> <!-- JDK toolchains --> <toolchain> @@ -307,7 +304,7 @@ <installDir>/path/to/netbeans/5.5</installDir> </configuration> </toolchain> -</toolchains></code></pre> +</toolchains></pre></div> <p>You can configure as many toolchains as you want in your <code>toolchains.xml</code> file.</p></section></section> </main> </div> Modified: maven/website/content/guides/mini/guide-wagon-providers.html ============================================================================== --- maven/website/content/guides/mini/guide-wagon-providers.html (original) +++ maven/website/content/guides/mini/guide-wagon-providers.html Sun May 12 07:42:36 2024 @@ -2,17 +2,17 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/guide-wagon-providers.apt at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/guide-wagon-providers.apt at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="John Casey" /> <meta name="date" content="2009-07-13" /> - <title>Maven</title> + <title>Maven â Guide to Selecting Alternative Wagon Providers</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -39,10 +39,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -50,9 +48,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-wagon-providers.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to Selecting Alternative Wagon Providers <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/guide-wagon-providers.apt"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -162,19 +159,20 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Guide_to_Selecting_Alternative_Wagon_Providers"></a> +<section> <h1>Guide to Selecting Alternative Wagon Providers</h1> <p>By default, Maven uses the <code>java.net.URLConnection</code> (<code>HttpURLConnection</code>) classes provided with the JDK to access repositories that use the HTTP/HTTPs protocols. Unfortunately, since this implementation contains certain bugs, Maven users may find themselves unable to connect to servers that demand some configurations. A couple examples of weird behavior include line-wrapping the Authorization header's Base64 value when passwords are long, and using cached values in preemptive authentication for successive connections to the same server.</p> <p>Maven 2.2.0 attempted to amend this problem by switching over to a Wagon implementation that's based on Apache HttpClient. Unfortunately, it soon became apparent that HttpClient doesn't support NTLM (at least, version 2), which effectively means users behind NTLMv2 proxies cannot use Maven 2.2.0.</p> <p>To hopefully resolve this once and for all, Maven 2.2.1 will contain support for specifying which Wagon provider you want to use for a given protocol during the build. The provider name will then be appended to the protocol using the format <code><protocol>-<provider></code> to form the component role-hint for the Wagon.</p> -<p>As of Maven 2.2.1, there are two ways to specify which Wagon provider should be used: via the command line, or in the <code><server></code> configuration section of the <code>settings.xml</code>.</p><section><a id="Command-Line_Configuration"></a> +<p>As of Maven 2.2.1, there are two ways to specify which Wagon provider should be used: via the command line, or in the <code><server></code> configuration section of the <code>settings.xml</code>.</p><section> <h2>Command-Line Configuration</h2> <p>To specify the Wagon provider from the command line, simply use the <code>-Dmaven.wagon.provider.<protocol>=<provider-name></code> command-line option, like the following:</p> -<pre>mvn -Dmaven.wagon.provider.http=httpclient clean install</pre> -<p>This instructs Maven to use the HttpClient-based Wagon implementation for connections to HTTP repositories.</p></section><section><a id="settings.xml_Configuration"></a> +<div class="verbatim"> +<pre>mvn -Dmaven.wagon.provider.http=httpclient clean install</pre></div> +<p>This instructs Maven to use the HttpClient-based Wagon implementation for connections to HTTP repositories.</p></section><section> <h2><code>settings.xml</code> Configuration</h2> <p>To specify which Wagon provider to use for a particular server, modify your <code>settings.xml</code> file to add the <code><wagonProvider></code> configuration to your <code><server></code> entry, like the following:</p> -<pre><code><settings> +<div class="verbatim source"><pre class="prettyprint linenums"><settings> [...] <servers> <server> @@ -183,15 +181,15 @@ <wagonProvider>httpclient</wagonProvider> [...] </configuration> - </server></code></pre></section><section><a id="Available_Wagon_Providers"></a> + </server></pre></div></section><section> <h2>Available Wagon Providers</h2> <p>Maven 2.2.1 provides two providers for HTTP/HTTPS Wagons: <code>lightweight</code> and <code>httpclient</code>. If you add a new HTTP Wagon implementation via build extension, you'll need to make sure the extension binds its Wagon components to role-hints of the form <code><protocol>-<provider></code> in order to allow users to specify your alternative Wagon provider. For instance, the HttpClient HTTP Wagon component definition looks like this:</p> -<pre><code><component> +<div class="verbatim source"><pre class="prettyprint linenums"><component> <role>org.apache.maven.wagon.Wagon</role> <role-hint>http-httpclient</role-hint> <implementation>org.apache.maven.wagon.providers.http.HttpWagon</implementation> <instantiation-strategy>per-lookup</instantiation-strategy> -</component></code></pre> +</component></pre></div> <p><b>NOTE:</b> The default provider for HTTP/HTTPS Wagons is <code>lightweight</code>.</p></section></section> </main> </div> Modified: maven/website/content/guides/mini/index.html ============================================================================== --- maven/website/content/guides/mini/index.html (original) +++ maven/website/content/guides/mini/index.html Sun May 12 07:42:36 2024 @@ -2,17 +2,17 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/mini/index.apt.vm at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/mini/index.apt.vm at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Jason van Zyl" /> <meta name="date" content="2005-10-12" /> - <title>Maven</title> + <title>Maven â Maven Mini Guides</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -39,10 +39,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -50,9 +48,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/index.apt.vm"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Maven Mini Guides <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/mini/index.apt.vm"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -163,7 +160,7 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Maven_Mini_Guides"></a> +<section> <h1>Maven Mini Guides</h1> <ul> <li><a href="./guide-reproducible-builds.html">Configuring for Reproducible Builds</a></li> Modified: maven/website/content/guides/plugin/guide-java-plugin-development.html ============================================================================== --- maven/website/content/guides/plugin/guide-java-plugin-development.html (original) +++ maven/website/content/guides/plugin/guide-java-plugin-development.html Sun May 12 07:42:36 2024 @@ -2,19 +2,19 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/plugin/guide-java-plugin-development.apt.vm at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/plugin/guide-java-plugin-development.apt.vm at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Bob Allison" /> <meta name="author" content="Vincent Siveton" /> <meta name="author" content="Olivier Lamy" /> <meta name="date" content="2013-01-02" /> - <title>Maven</title> + <title>Maven â Guide to Developing Java Plugins</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -41,10 +41,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -52,9 +50,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/plugin/guide-java-plugin-development.apt.vm"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to Developing Java Plugins <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/plugin/guide-java-plugin-development.apt.vm"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -145,7 +142,7 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Guide_to_Developing_Java_Plugins"></a> +<section> <h1>Guide to Developing Java Plugins</h1> <p>This guide is intended to assist users in developing Java plugins for Maven.</p> <ul> @@ -180,7 +177,7 @@ <p>When processing the source tree to find mojos, <a href="/plugin-tools/"> <code>plugin-tools</code></a> looks for classes with <code>@Mojo</code> Java 5 annotation. Any class with this annotation are included in the plugin configuration file.</p><section> <h4><a id="A_Simple_Mojo">A Simple Mojo</a></h4> <p>Listed below is a simple mojo class which has no parameters. This is about as simple as a mojo can be. After the listing is a description of the various parts of the source.</p> -<pre><code>package sample.plugin; +<div class="verbatim source"><pre class="prettyprint linenums">package sample.plugin; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; @@ -197,7 +194,7 @@ public class GreetingMojo extends Abstra { getLog().info("Hello, world."); } -}</code></pre> +}</pre></div> <ul> <li>The class <code>org.apache.maven.plugin.AbstractMojo</code> provides most of the infrastructure required to implement a mojo except for the <code>execute</code> method.</li> <li>The annotation "<code>@Mojo</code>" is required and control how and when the mojo is executed.</li> @@ -223,7 +220,7 @@ public class GreetingMojo extends Abstra <td style="text-align: left;"><code>dependencies</code></td> <td style="text-align: left;">A dependency must be declared to the Maven Plugin Tools API to resolve "<code>AbstractMojo</code>" and related classes</td></tr></table> <p>Listed below is an illustration of the sample mojo project's pom with the parameters set as described in the above table:</p> -<pre><code><project> +<div class="verbatim source"><pre class="prettyprint linenums"><project> <modelVersion>4.0.0</modelVersion> <groupId>sample.plugin</groupId> @@ -272,7 +269,7 @@ public class GreetingMojo extends Abstra </plugin> </pluginManagement> </build> -</project></code></pre></section><section> +</project></pre></div></section><section> <h3><a id="Building_a_Plugin">Building a Plugin</a></h3> <p>There are few plugins goals bound to the standard build lifecycle defined with the <code>maven-plugin</code> packaging:</p> <table class="table table-bordered table-striped"> @@ -297,7 +294,7 @@ public class GreetingMojo extends Abstra <p>For more details, you can look at <a href="/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_maven-plugin_packaging"> detailed bindings for <code>maven-plugin</code> packaging</a>.</p></section><section> <h3><a id="Executing_Your_First_Mojo">Executing Your First Mojo</a></h3> <p>The most direct means of executing your new plugin is to specify the plugin goal directly on the command line. To do this, you need to configure the <code>hello-maven-plugin</code> plugin in you project:</p> -<pre><code><project> +<div class="verbatim source"><pre class="prettyprint linenums"><project> ... <build> <pluginManagement> @@ -311,9 +308,10 @@ public class GreetingMojo extends Abstra </pluginManagement> </build> ... -</project></code></pre> +</project></pre></div> <p>And, you need to specify a fully-qualified goal in the form of:</p> -<pre>mvn groupId:artifactId:version:goal</pre> +<div class="verbatim"> +<pre>mvn groupId:artifactId:version:goal</pre></div> <p>For example, to run the simple mojo in the sample plugin, you would enter "<code>mvn sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:sayhi</code>" on the command line.</p> <p><b>Tips</b>: <code>version</code> is not required to run a standalone goal.</p><section> <h4><a id="Shortening_the_Command_Line">Shortening the Command Line</a></h4> @@ -322,13 +320,13 @@ public class GreetingMojo extends Abstra <li>If you need to run the latest version of a plugin installed in your local repository, you can omit its version number. So just use "<code>mvn sample.plugin:hello-maven-plugin:sayhi</code>" to run your plugin.</li> <li>You can assign a shortened prefix to your plugin, such as <code>mvn hello:sayhi</code>. This is done automatically if you follow the convention of using <code>${prefix}-maven-plugin</code> (or <code>maven-${prefix}-plugin</code> if the plugin is part of the Apache Maven project). You may also assign one through additional configuration - for more information see <a href="../introduction/introduction-to-plugin-prefix-mapping.html"> Introduction to Plugin Prefix Mapping</a>.</li> <li>Finally, you can also add your plugin's groupId to the list of groupIds searched by default. To do this, you need to add the following to your <code>${user.home}/.m2/settings.xml</code> file: -<pre><code><pluginGroups> +<div class="verbatim source"><pre class="prettyprint linenums"><pluginGroups> <pluginGroup>sample.plugin</pluginGroup> -</pluginGroups></code></pre></li></ul> +</pluginGroups></pre></div></li></ul> <p>At this point, you can run the mojo with "<code>mvn hello:sayhi</code>".</p></section><section> <h4><a id="Attaching_the_Mojo_to_the_Build_Lifecycle">Attaching the Mojo to the Build Lifecycle</a></h4> <p>You can also configure your plugin to attach specific goals to a particular phase of the build lifecycle. Here is an example:</p> -<pre><code> <build> +<div class="verbatim source"><pre class="prettyprint linenums"> <build> <pluginManagement> <plugins> <plugin> @@ -352,15 +350,16 @@ public class GreetingMojo extends Abstra </executions> </plugin> </plugins> - </build></code></pre> + </build></pre></div> <p>This causes the simple mojo to be executed whenever Java code is compiled. For more information on binding a mojo to phases in the lifecycle, please refer to the <a href="../introduction/introduction-to-the-lifecycle.html">Build Lifecycle</a> document.</p></section></section></section><section> <h2><a id="Mojo_archetype">Mojo archetype</a></h2> <p>To create a new plugin project, you could using the Mojo <a href="../introduction/introduction-to-archetypes.html">archetype</a> with the following command line:</p> +<div class="verbatim"> <pre>mvn archetype:generate \ -DgroupId=sample.plugin \ -DartifactId=hello-maven-plugin \ -DarchetypeGroupId=org.apache.maven.archetypes \ - -DarchetypeArtifactId=maven-archetype-plugin</pre></section><section> + -DarchetypeArtifactId=maven-archetype-plugin</pre></div></section><section> <h2><a id="Parameters">Parameters</a></h2> <p>It is unlikely that a mojo will be very useful without parameters. Parameters provide a few very important functions:</p> <ul> @@ -368,28 +367,28 @@ public class GreetingMojo extends Abstra <li>It provides a means to easily extract the value of elements from the POM without the need to navigate the objects.</li></ul><section> <h3><a id="Defining_Parameters_Within_a_Mojo">Defining Parameters Within a Mojo</a></h3> <p>Defining a parameter is as simple as creating an instance variable in the mojo and adding the proper annotations. Listed below is an example of a parameter for the simple mojo:</p> -<pre><code> /** +<div class="verbatim source"><pre class="prettyprint linenums"> /** * The greeting to display. */ @Parameter(property = "sayhi.greeting", defaultValue = "Hello World!" ) - private String greeting;</code></pre> + private String greeting;</pre></div> <p>The portion before the annotations is the description of the parameter. The <code>@Parameter</code> annotation identifies the variable as a mojo parameter. The <code>defaultValue</code> parameter of the annotation defines the default value for the variable. This value can include expressions which reference the project, such as "<code>${project.version}</code>" (more can be found in the <a href="/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html">"Parameter Expressions" document</a>). The <code>property</code> parameter can be used to allow configuration of the mojo parameter from the command line by referencing a system property that the user sets via the <code>-D</code> option.</p></section><section> <h3><a id="Configuring_Parameters_in_a_Project">Configuring Parameters in a Project</a></h3> <p>Configuring the parameter values for a plugin is done in a Maven project within the <code>pom.xml</code> file as part of defining the plugin in the project. An example of configuring a plugin:</p> -<pre><code><plugin> +<div class="verbatim source"><pre class="prettyprint linenums"><plugin> <groupId>sample.plugin</groupId> <artifactId>hello-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <greeting>Welcome</greeting> </configuration> -</plugin></code></pre> +</plugin></pre></div> <p>In the configuration section, the element name ("<code>greeting</code>") is the parameter name and the contents of the element ("<code>Welcome</code>") is the value to be assigned to the parameter.</p> <p><b>Note</b>: More details can be found in the <a href="../mini/guide-configuring-plugins.html">Guide to Configuring Plugins</a>.</p></section></section><section> <h2><a id="Using_Setters">Using Setters</a></h2> <p>You are not restricted to using private field mapping which is good if you are trying to make you Mojos resuable outside the context of Maven. Using the example above we could define public setters methods that the configuration mapping mechanism can use. You can also add <code>@Parameter</code> annotation on setter method (from version 3.7.0 of `plugin-tools`)</p> <p>So our Mojo would look like the following:</p> -<pre><code> +<div class="verbatim source"><pre class="prettyprint linenums"> public class MyQueryMojo extends AbstractMojo { // provide name for non matching field and setter name @@ -421,10 +420,10 @@ public class MyQueryMojo extends Abstrac ... } } -</code></pre> +</pre></div> <p>Note the specification of the property name for each parameter which tells Maven what setter and getter to use when the field's name does not match the intended name of the parameter in the plugin configuration.</p></section><section> <h2><a id="Resources">Resources</a></h2> -<ol style="list-style-type: decimal;"> +<ol style="list-style-type: decimal"> <li><a href="../../developers/mojo-api-specification.html">Mojo Documentation</a>: Mojo API, Mojo annotations</li> <li><a href="/shared/maven-plugin-testing-harness/">Maven Plugin Testing Harness</a>: Testing framework for your Mojos.</li> <li><a class="externalLink" href="https://codehaus-plexus.github.io/">Plexus</a>: The IoC container used by Maven.</li> Modified: maven/website/content/guides/plugin/guide-java-report-plugin-development.html ============================================================================== --- maven/website/content/guides/plugin/guide-java-report-plugin-development.html (original) +++ maven/website/content/guides/plugin/guide-java-report-plugin-development.html Sun May 12 07:42:36 2024 @@ -2,18 +2,18 @@ <!-- - | Generated by Apache Maven Doxia Site Renderer 2.0.0-M18 from content/apt/guides/plugin/guide-java-report-plugin-development.apt.vm at 2024-05-11 + | Generated by Apache Maven Doxia Site Renderer 2.0.0-M10 from content/apt/guides/plugin/guide-java-report-plugin-development.apt.vm at 2024-05-12 | Rendered using Apache Maven Fluido Skin 2.0.0-M6 --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M18" /> + <meta name="generator" content="Apache Maven Doxia Site Renderer 2.0.0-M10" /> <meta name="author" content="Hervé Boutemy" /> <meta name="author" content="Bertrand Martin" /> <meta name="date" content="2018-01-21" /> - <title>Maven</title> + <title>Maven â Guide to Developing Java Report Plugins</title> <link rel="stylesheet" href="../../css/apache-maven-fluido-2.0.0-M6.min.css" /> <link rel="stylesheet" href="../../css/site.css" /> <link rel="stylesheet" href="../../css/print.css" media="print" /> @@ -40,10 +40,8 @@ <div class="container-fluid"> <header> <div id="banner"> - <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><h1>Apache Maven Site</h1> -</a></div> - <div class="pull-right"><a href="../.././" id="bannerRight"><h1>$esc.xml( $banner.name )</h1> -</a></div> + <div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div> + <div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div> <div class="clear"><hr/></div> </div> @@ -51,9 +49,8 @@ <ul class="breadcrumb"> <li><a href="https://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li> <li><a href="../../index.html" title="Maven">Maven</a><span class="divider">/</span></li> - - <li class="active ">Maven <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/plugin/guide-java-report-plugin-development.apt.vm"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> - <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-11</li> + <li class="active ">Guide to Developing Java Report Plugins <a href="https://github.com/apache/maven-site/tree/master/content/apt/guides/plugin/guide-java-report-plugin-development.apt.vm"><img src="../../images/accessories-text-editor.png" title="Edit" /></a></li> + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2024-05-12</li> <li class="pull-right"><span class="divider">|</span> <a href="../../scm.html" title="Get Sources">Get Sources</a></li> <li class="pull-right"><a href="../../download.cgi" title="Download">Download</a></li> @@ -144,16 +141,16 @@ </div> </header> <main id="bodyColumn" class="span10" > -<section><a id="Introduction"></a> +<section> <h1>Introduction</h1> <p>This guide is intended to assist users in developing reporting plugins for Maven in Java, that will contribute to sites generated by <a href="/plugins/maven-site-plugin/"><code>maven-site-plugin</code></a> or site PDF documents generated by <a href="/plugins/maven-pdf-plugin/"><code>maven-pdf-site</code></a>.</p> <p>First and foremost, a <i>report plugin</i> is a <i>Maven plugin</i> and it is strongly advised to first read the <a href="./guide-java-plugin-development.html">Guide to Developing Java Plugins</a> to properly understand its core mechanisms.</p> <p>A plugin is actually not a <i>report plugin</i> in itself. But one (or several) of its goals or <i>Mojos</i> may be specialized to be invoked by <a href="/plugins/maven-site-plugin/"><code>maven-site-plugin</code></a>, typically during the <code>site</code> build life cycle.</p> -<p>A Maven plugin can therefore implement <i>regular</i> goals and <i>report</i> goals. The below details how to write a <i>Mojo</i> that will get invoked as a <i>report</i> by <a href="/plugins/maven-site-plugin/"><code>maven-site-plugin</code></a>.</p><section><a id="How_It_Works"></a> +<p>A Maven plugin can therefore implement <i>regular</i> goals and <i>report</i> goals. The below details how to write a <i>Mojo</i> that will get invoked as a <i>report</i> by <a href="/plugins/maven-site-plugin/"><code>maven-site-plugin</code></a>.</p><section> <h2>How It Works</h2> -<ol style="list-style-type: decimal;"> +<ol style="list-style-type: decimal"> <li> A regular Maven project usually invokes <i>reporting goals</i> of a plugin by declaring such plugin in the <a href="/plugins/maven-site-plugin/examples/configuring-reports.html"><code><reporting></code></a> section of its <code>pom.xml</code> as in the example below: -<pre><code><project> +<div class="verbatim source"><pre class="prettyprint linenums"><project> ... <reporting> <plugins> @@ -164,12 +161,12 @@ </plugin> </plugins> </reporting> - ...</code></pre></li> + ...</pre></div></li> <li> When <a href="/plugins/maven-site-plugin/"><code>maven-site-plugin</code></a> is invoked (for example with the <code>mvn site</code> command), the specified plugins are loaded and the <code>generate()</code> method of each Mojo class that implements <a href="/shared/maven-reporting-api/apidocs/org/apache/maven/reporting/MavenReport.html"><code>MavenReport</code></a> is executed.</li> <li> The <code>generate()</code> method generates a document through Maven's <a href="/doxia/doxia/doxia-sink-api/">Doxia Sink API</a>. This document is comprised of basic elements like title, headings, text, links, tables, etc. This is where you will put the logic of your report, assembling elements, based on the content of the Maven project.</li> <li> These document elements are passed to Doxia to generate an HTML document, which itself gets wrapped into a <a href="/skins/">Maven Skin</a>, as specified in the projects <a href="/guides/mini/guide-site.html"><code>./src/site/site.xml</code></a>.</li> <li> The result produces an HTML file in the <code>./target/site</code> directory of your project.</li></ol> -<p><a href="/doxia/doxia-sitetools/doxia-site-renderer/">More details about Doxia Site Renderer</a></p></section><section><a id="Basic_Requirements_of_a_Report_Mojo"></a> +<p><a href="/doxia/doxia-sitetools/doxia-site-renderer/">More details about Doxia Site Renderer</a></p></section><section> <h2>Basic Requirements of a Report <i>Mojo</i></h2> <p>Each goal or <i>Mojo</i> is implemented with a separate Java class. For a <i>Mojo</i> to become a <i>report Mojo</i>, it needs to implement <a href="/shared/maven-reporting-api/apidocs/org/apache/maven/reporting/MavenReport.html"><code>org.apache.maven.reporting.MavenReport</code></a> (in addition to <a href="/ref/current/apidocs/org/apache/maven/plugin/Mojo.html"><code>org.apache.maven.plugin.Mojo</code></a>).</p> <p>An easy way to implement both <code>Mojo</code> and <code>MavenReport</code> interfaces is to extend the <a href="/shared/maven-reporting-impl/apidocs/org/apache/maven/reporting/AbstractMavenReport.html"><code>org.apache.maven.reporting.AbstractMavenReport</code></a> class provided by <a href="/shared/maven-reporting-impl/"><code>maven-reporting-impl</code></a> (instead of <code>org.apache.maven.plugin.AbstractMojo</code> for a regular <i>Mojo</i>).</p> @@ -182,7 +179,7 @@ <p>To build a Maven plugin that includes <i>report Mojos</i>, the <code>pom.xml</code> of your project will need declare the project as a regular plugin, and include specific dependencies required by the report <i>Mojos</i>:</p> <ul> <li><a href="/shared/maven-reporting-impl/dependency-info.html"><code>org.apache.maven.reporting:maven-reporting-impl</code></a></li> -<li><a href="/shared/maven-reporting-api/project-summary.html"><code>org.apache.maven.reporting:maven-reporting-api</code></a></li></ul></section><section><a id="A_.28Very.29_Simple_Report"></a> +<li><a href="/shared/maven-reporting-api/project-summary.html"><code>org.apache.maven.reporting:maven-reporting-api</code></a></li></ul></section><section> <h2>A (Very) Simple Report</h2> <p>Let's write a very simple <i>report Mojo</i> in a very simple Maven plugin:</p> <ul> @@ -194,9 +191,9 @@ <ul> <li><code>./pom.xml</code></li> <li><code>./src/main/java/com/mycompany/maven/SimpleReport.java</code></li></ul> -<p>The below examples can be copied and pasted as a template.</p><section><a id="a..2Fpom.xml"></a> +<p>The below examples can be copied and pasted as a template.</p><section> <h3>./pom.xml</h3> -<pre><code><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<div class="verbatim source"><pre class="prettyprint linenums"><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> @@ -290,9 +287,9 @@ </plugins> </build> -</project></code></pre></section><section><a id="a..2Fsrc.2Fmain.2Fjava.2Fcom.2Fmycompany.2Fmaven.2FSimpleReport.java"></a> +</project></pre></div></section><section> <h3>./src/main/java/com/mycompany/maven/SimpleReport.java</h3> -<pre><code>package com.mycompany.maven; +<div class="verbatim source"><pre class="prettyprint linenums">package com.mycompany.maven; import java.util.Locale; @@ -389,16 +386,18 @@ public class SimpleReport extends Abstra } -}</code></pre></section><section><a id="Building_the_Simple_Plugin"></a> +}</pre></div></section><section> <h3>Building the Simple Plugin</h3> <p>Building the plugin is done by executing the below command in the root directory of the plugin project:</p> -<pre>$ mvn install</pre> +<div class="verbatim"> +<pre>$ mvn install</pre></div> <p>This command will:</p> <ul> <li>compile your code</li> <li>produces the plugin JAR artifact (<code>./target/simple-maven-plugin-1.0-SNAPSHOT.jar</code>)</li> <li>copy the artifact to your local repository so that it can be "consumed" by other projects (which is the purpose of a plugin, right?).</li></ul> <p>To make sure everything went well and is properly declared, you can now execute the below command in any other Maven project directory:</p> +<div class="verbatim"> <pre>$ mvn com.mycompany.maven:simple-maven-plugin:1.0-SNAPSHOT:help [INFO] --- simple-maven-plugin:1.0-SNAPSHOT:help (default-cli) @ hardware-connectors --- @@ -420,10 +419,10 @@ simple:simple [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------</pre></section><section><a id="Invoking_the_Simple_Plugin"></a> +[INFO] ------------------------------------------------------------------------</pre></div></section><section> <h3>Invoking the Simple Plugin</h3> <p>To invoke the <i>report Mojo</i> of our plugin in another Maven project, we just need to declare the plugin in the <a href="/plugins/maven-site-plugin/examples/configuring-reports.html"><code><reporting></code></a> section of its <code>pom.xml</code> as in the example below:</p> -<pre><code><project> +<div class="verbatim source"><pre class="prettyprint linenums"><project> ... <reporting> <plugins> @@ -435,13 +434,13 @@ simple:simple </plugins> </reporting> ... -</project></code></pre> -<p>Note: When no specific report is specified, all of the <i>Mojos</i> in the plugin, that are declared as "reporting" will be executed. <a href="/plugins/maven-site-plugin/examples/configuring-reports.html">More information about configuring reports</a>.</p></section></section><section><a id="More_Information"></a> -<h2>More Information</h2><section><a id="The_Doxia_Sink_API"></a> +</project></pre></div> +<p>Note: When no specific report is specified, all of the <i>Mojos</i> in the plugin, that are declared as "reporting" will be executed. <a href="/plugins/maven-site-plugin/examples/configuring-reports.html">More information about configuring reports</a>.</p></section></section><section> +<h2>More Information</h2><section> <h3>The Doxia Sink API</h3> <p>In your <code>executeReport()</code> method, you will leverage the <a href="/doxia/doxia/doxia-sink-api/">Doxia Sink API</a> to add elements to the report document.</p> <p>You will use the <a href="/doxia/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/Sink.html"><code>Sink</code></a> object associated to the report:</p> -<pre><code>Sink sink = getSink();</code></pre> +<div class="verbatim source"><pre class="prettyprint linenums">Sink sink = getSink();</pre></div> <p>This object allows you to append new elements to the report document (initially empty). Unlike some DOM manipulation APIs, you cannot insert elements in already existing elements, or remove elements.</p> <p>The elements that you append to the document will look familiar if you have basic knowledge of HTML. Most of the elements have opening and closing tags, like <code>sink.body()</code> (opening) and <code>sink.body_()</code> (closing).</p> <ul> @@ -457,10 +456,10 @@ simple:simple <li>Body (<code>sink.body()</code>)</li> <li>Section 1 with title (<code>sink.section1()</code> and <code>sink.sectionTitle1()</code>)</li></ul> <p>The <a href="/doxia/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/Sink.html"><code>Sink</code></a> object allows you to add raw text with the <i>rawText()</i> method. More precisely, it allows you to add raw HTML code into the document for full flexibility. However, you should limit the usage of this method as you may add elements that are not supported by non-HTML renderers (like <a href="/plugins/maven-pdf-plugin/"><code>maven-pdf-site</code></a>).</p> -<p>The Doxia Sink API allows you to specify <a href="/doxia/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/SinkEventAttributes.html"><i>SinkEventAttributes</i></a> to each element, i.e. HTML properties, notably the class and the ID of an object, which allows for easy customization with an appropriate CSS (either provided by the specified Maven Skin, or by the project itself).</p></section><section><a id="Creating_more_than_one_document"></a> +<p>The Doxia Sink API allows you to specify <a href="/doxia/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/SinkEventAttributes.html"><i>SinkEventAttributes</i></a> to each element, i.e. HTML properties, notably the class and the ID of an object, which allows for easy customization with an appropriate CSS (either provided by the specified Maven Skin, or by the project itself).</p></section><section> <h3>Creating more than one document</h3> <p>You may need to create not just one HTML file, but several of them (like Javadoc produces one HTML file for each Java class). To do so, you will need to get a new <i>Sink</i> for each HTML file you need to produce. This is achieved by using the <a href="/doxia/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/SinkFactory.html"><code>SinkFactory</code></a> object that you can easily obtain with the <a href="/shared/maven-reporting-impl/apidocs/org/apache/maven/reporting/AbstractMavenReport.html#getSinkFactory.28.29"><code>getSinkFactory()</code></a> method of your <a href="/shared/maven-reporting-impl/apidocs/org/apache/maven/reporting/AbstractMavenReport.html"><code>AbstractMavenReport</code></a> instance, as in the example below.</p> -<pre><code>public class SimpleReport extends AbstractMavenReport { +<div class="verbatim source"><pre class="prettyprint linenums">public class SimpleReport extends AbstractMavenReport { ... @@ -490,11 +489,11 @@ simple:simple otherSink.head(); otherSink.title(); otherSink.text("The Other Report"); - ...</code></pre> + ...</pre></div> <p>The above example will create a <code>other-report.html</code> HTML file along with <code>simple-report.html</code>.</p> -<p>Note: Despite the fact that you will be creating additional HTML files, the Velocity variable <code>guides/plugin/guide-java-report-plugin-development.html</code> passed to the <code>site.vm</code> script of the Maven Skin will keep the name of the original report (i.e. the result of your <i>getOutputName()</i> method). <a href="/doxia/doxia-sitetools/doxia-site-renderer/">More information about the Velocity variables</a>.</p></section></section><section><a id="Resources"></a> +<p>Note: Despite the fact that you will be creating additional HTML files, the Velocity variable <code>guides/plugin/guide-java-report-plugin-development.html</code> passed to the <code>site.vm</code> script of the Maven Skin will keep the name of the original report (i.e. the result of your <i>getOutputName()</i> method). <a href="/doxia/doxia-sitetools/doxia-site-renderer/">More information about the Velocity variables</a>.</p></section></section><section> <h2>Resources</h2> -<ol style="list-style-type: decimal;"> +<ol style="list-style-type: decimal"> <li><a href="./guide-java-plugin-development.html">Guide to Developing Java Plugins</a>: Starting point, since a reporting plugin is a plugin...</li> <li><a href="/shared/maven-reporting-api/">Maven Reporting API</a>: The Reporting API to implement when a Mojo provides reporting for site.</li> <li><a href="/shared/maven-reporting-impl/">Maven Reporting Implementation</a>: Base implementation of both Reporting API and Plugin API.</li>