Skip to content

Commit cb6b61a

Browse files
committed
Publishing documentation for version 0.11.2-SNAPSHOT
1 parent ea96391 commit cb6b61a

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed

0.11.2-SNAPSHOT/changelog.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,12 @@ <h2 id="_release_0_11_1"><a class="anchor" href="#_release_0_11_1"></a>Release 0
537537
<li>
538538
<p>Fix <code>NoClassDefFoundError</code> when JUnit feature is missing some dependency</p>
539539
</li>
540+
<li>
541+
<p>Add <code>skipTestExecution</code> support to <code>native-maven-plugin</code></p>
542+
</li>
543+
<li>
544+
<p>Add <code>failNoTests</code> support to <code>native-maven-plugin</code></p>
545+
</li>
540546
</ul>
541547
</div>
542548
</div>

0.11.2-SNAPSHOT/end-to-end-maven-guide.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,8 @@ <h1>Building Native Images with Maven: An End-to-End Guide</h1>
480480
<li><a href="#advanced-use-cases">Advanced Use Cases: How to</a>
481481
<ul class="sectlevel2">
482482
<li><a href="#configure-image-build">Configure Native Image Build</a></li>
483+
<li><a href="#_build_but_not_execute_native_tests">Build, but not execute native tests</a></li>
484+
<li><a href="#_skip_modules_without_native_tests_in_multi_module_builds">Skip modules without native tests in multi-module builds</a></li>
483485
<li><a href="#gather-execution-profiles">Gather Execution Profiles and Build Optimized Images</a></li>
484486
<li><a href="#troubleshoot-missing-configuration">Troubleshoot Missing Configuration</a></li>
485487
<li><a href="#use-diagnostics-tools">Use Diagnostics Tools</a></li>
@@ -804,6 +806,21 @@ <h3 id="configure-image-build"><a class="anchor" href="#configure-image-build"><
804806
</div>
805807
</div>
806808
<div class="sect2">
809+
<h3 id="_build_but_not_execute_native_tests"><a class="anchor" href="#_build_but_not_execute_native_tests"></a>Build, but not execute native tests</h3>
810+
<div class="paragraph">
811+
<p>During a transition phase, it is often useful to build tests but not execute them. This allows inspection of the generated test image without failing the build when the tests do not execute successfully.</p>
812+
</div>
813+
<div class="paragraph">
814+
<p>If you wish to build, but not execute, the native tests, invoke Maven with the <code>-DskipTestExecution</code> switch or set the value in the plugin configuration.</p>
815+
</div>
816+
</div>
817+
<div class="sect2">
818+
<h3 id="_skip_modules_without_native_tests_in_multi_module_builds"><a class="anchor" href="#_skip_modules_without_native_tests_in_multi_module_builds"></a>Skip modules without native tests in multi-module builds</h3>
819+
<div class="paragraph">
820+
<p>Multi-module projects where only some sub-modules contain native tests need to skip test execution for any module that do not contain native tests. Skip test execution for modules by setting the <code>&lt;failNoTests&gt;</code> configuration to <code>false</code> or providing <code>-DfailNoTests=false</code> on the command line.</p>
821+
</div>
822+
</div>
823+
<div class="sect2">
807824
<h3 id="gather-execution-profiles"><a class="anchor" href="#gather-execution-profiles"></a>Gather Execution Profiles and Build Optimized Images</h3>
808825
<div class="paragraph">
809826
<p>You may want to gather profiling information from your application&#8217;s execution to pinpoint areas of inefficiency.

0.11.2-SNAPSHOT/maven-plugin.html

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ <h1>Maven plugin for GraalVM Native Image</h1>
491491
<ul class="sectlevel2">
492492
<li><a href="#testing-support-version-compatibility">Version Compatibility</a></li>
493493
<li><a href="#testing-support-disabling">Disabling Testing Support</a></li>
494+
<li><a href="#control-test-execution">Controlling test execution</a></li>
494495
</ul>
495496
</li>
496497
<li><a href="#metadata-support">GraalVM Reachability Metadata Support</a>
@@ -622,6 +623,32 @@ <h3 id="native-image-options"><a class="anchor" href="#native-image-options"></a
622623
</div>
623624
<div class="dlist">
624625
<dl>
626+
<dt class="hdlist1"><code>&lt;skipTestExecution&gt;</code></dt>
627+
<dd>
628+
<p>Skips execution of native tests. If set to true, the plugin will create the native image for the tests but will not execute the tests. This allows the creation of the native image for testing even when tests don&#8217;t fully execute or tests fail. Otherwise, the build stops at the first test failure. To skip only the execution of the native image compiled tests, add:</p>
629+
</dd>
630+
</dl>
631+
</div>
632+
<div class="listingblock multi-language-sample">
633+
<div class="content">
634+
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;skipNativeTests&gt;true&lt;/skipNativeTests&gt;</code></pre>
635+
</div>
636+
</div>
637+
<div class="dlist">
638+
<dl>
639+
<dt class="hdlist1"><code>&lt;failNoTests&gt;</code></dt>
640+
<dd>
641+
<p>Fails the build if no tests were found. In multi-module builds, there are often modules that have no tests (for example, a documentation module ) or where tests are enabled or disabled by profiles (such as slow tests, e2e tests, etc.). This switch allows for a global configuration of the native plugin and then allows you to skip any modules where no tests are present by changing this setting to false in the sub-module. This allows such multi-module projects to build successfully. To avoid failing the build in a module where no tests are present, add:</p>
642+
</dd>
643+
</dl>
644+
</div>
645+
<div class="listingblock multi-language-sample">
646+
<div class="content">
647+
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;failNoTests&gt;false&lt;/failNoTests&gt;</code></pre>
648+
</div>
649+
</div>
650+
<div class="dlist">
651+
<dl>
625652
<dt class="hdlist1"><code>&lt;debug&gt;</code></dt>
626653
<dd>
627654
<p>If you want to enable generation of debugging information, add:</p>
@@ -1585,6 +1612,89 @@ <h3 id="testing-support-disabling"><a class="anchor" href="#testing-support-disa
15851612
</ul>
15861613
</div>
15871614
</div>
1615+
<div class="sect2">
1616+
<h3 id="control-test-execution"><a class="anchor" href="#control-test-execution"></a>Controlling test execution</h3>
1617+
<div class="sect3">
1618+
<h4 id="_build_but_not_execute_native_tests"><a class="anchor" href="#_build_but_not_execute_native_tests"></a>Build, but not execute native tests</h4>
1619+
<div class="paragraph">
1620+
<p>During a transition phase, it is often useful to build tests but not execute them. This allows inspection of the generated test image without failing the build when the tests do not execute successfully.</p>
1621+
</div>
1622+
<div class="paragraph">
1623+
<p>If you wish to build, but not execute, the native tests, invoke Maven with the <code>-DskipTestExecution</code> flag. This flag is specific to Native Build Tools.</p>
1624+
</div>
1625+
<div class="listingblock multi-language-sample">
1626+
<div class="content">
1627+
<pre class="highlightjs highlight"><code data-lang="bash" class="language-bash hljs">./mvnw -Pnative -DskipTestExecution package</code></pre>
1628+
</div>
1629+
</div>
1630+
<div class="paragraph">
1631+
<p>Alternatively, set <code>&lt;skipTestExecution&gt;</code> to <code>true</code> in the plugin configuration:</p>
1632+
</div>
1633+
<div class="listingblock multi-language-sample">
1634+
<div class="content">
1635+
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;configuration&gt;
1636+
&lt;skipTestExecution&gt;true&lt;/skipTestExecution&gt;
1637+
&lt;/configuration&gt;</code></pre>
1638+
</div>
1639+
</div>
1640+
<div class="paragraph">
1641+
<p>This will still build the native test image but skips execution of tests as native code.</p>
1642+
</div>
1643+
</div>
1644+
<div class="sect3">
1645+
<h4 id="_skip_modules_without_native_tests_in_multi_module_builds"><a class="anchor" href="#_skip_modules_without_native_tests_in_multi_module_builds"></a>Skip modules without native tests in multi-module builds</h4>
1646+
<div class="paragraph">
1647+
<p>In multi-module projects where only some sub-modules contain native tests, you need to skip test execution for any module that does not contain native tests. Any module which should contain tests, but does not, should fail the build.</p>
1648+
</div>
1649+
<div class="paragraph">
1650+
<p>Skip test execution for modules by configuring the <code>&lt;failNoTests&gt;</code> configuration option for the full build and then overriding it in modules where the default behavior is not desired.</p>
1651+
</div>
1652+
<div class="paragraph">
1653+
<p>If the majority of the sub-modules should contain native tests, nothing needs to be configured globally since this is the default behavior for the native plugin.</p>
1654+
</div>
1655+
<div class="paragraph">
1656+
<p>For sub-modules that do not contain native tests but should not fail the build, add this to the module&#8217;s <em>pom.xml</em> in the module in the <code>&lt;plugins&gt;</code> section:</p>
1657+
</div>
1658+
<div class="listingblock multi-language-sample">
1659+
<div class="content">
1660+
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;plugin&gt;
1661+
&lt;groupId&gt;org.graalvm.buildtools&lt;/groupId&gt;
1662+
&lt;artifactId&gt;native-maven-plugin&lt;/artifactId&gt;
1663+
&lt;configuration&gt;
1664+
&lt;failNoTests&gt;false&lt;/failNoTests&gt;
1665+
&lt;/configuration&gt;
1666+
&lt;/plugin&gt;</code></pre>
1667+
</div>
1668+
</div>
1669+
<div class="paragraph">
1670+
<p>If only a few sub-modules contain native tests, add this configuration setting to the main plugin configuration:</p>
1671+
</div>
1672+
<div class="listingblock multi-language-sample">
1673+
<div class="content">
1674+
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;configuration&gt;
1675+
&lt;failNoTests&gt;false&lt;/failNoTests&gt;
1676+
&lt;/configuration&gt;</code></pre>
1677+
</div>
1678+
</div>
1679+
<div class="paragraph">
1680+
<p>and then override this in any sub-module that should have native tests by adding this to the module in the <code>&lt;plugins&gt;</code> section:</p>
1681+
</div>
1682+
<div class="listingblock multi-language-sample">
1683+
<div class="content">
1684+
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;plugin&gt;
1685+
&lt;groupId&gt;org.graalvm.buildtools&lt;/groupId&gt;
1686+
&lt;artifactId&gt;native-maven-plugin&lt;/artifactId&gt;
1687+
&lt;configuration&gt;
1688+
&lt;failNoTests&gt;true&lt;/failNoTests&gt;
1689+
&lt;/configuration&gt;
1690+
&lt;/plugin&gt;</code></pre>
1691+
</div>
1692+
</div>
1693+
<div class="paragraph">
1694+
<p>For testing from the command line, the <code>-DfailNoTests=false</code> flag is also supported directly:</p>
1695+
</div>
1696+
</div>
1697+
</div>
15881698
</div>
15891699
</div>
15901700
<div class="sect1">

0 commit comments

Comments
 (0)