You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h3id="_build_but_not_execute_native_tests"><aclass="anchor" href="#_build_but_not_execute_native_tests"></a>Build, but not execute native tests</h3>
810
+
<divclass="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
+
<divclass="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
+
<divclass="sect2">
818
+
<h3id="_skip_modules_without_native_tests_in_multi_module_builds"><aclass="anchor" href="#_skip_modules_without_native_tests_in_multi_module_builds"></a>Skip modules without native tests in multi-module builds</h3>
819
+
<divclass="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><failNoTests></code> configuration to <code>false</code> or providing <code>-DfailNoTests=false</code> on the command line.</p>
821
+
</div>
822
+
</div>
823
+
<divclass="sect2">
807
824
<h3id="gather-execution-profiles"><aclass="anchor" href="#gather-execution-profiles"></a>Gather Execution Profiles and Build Optimized Images</h3>
808
825
<divclass="paragraph">
809
826
<p>You may want to gather profiling information from your application’s execution to pinpoint areas of inefficiency.
<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’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>
<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>
<h3id="control-test-execution"><aclass="anchor" href="#control-test-execution"></a>Controlling test execution</h3>
1617
+
<divclass="sect3">
1618
+
<h4id="_build_but_not_execute_native_tests"><aclass="anchor" href="#_build_but_not_execute_native_tests"></a>Build, but not execute native tests</h4>
1619
+
<divclass="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
+
<divclass="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>
<p>This will still build the native test image but skips execution of tests as native code.</p>
1642
+
</div>
1643
+
</div>
1644
+
<divclass="sect3">
1645
+
<h4id="_skip_modules_without_native_tests_in_multi_module_builds"><aclass="anchor" href="#_skip_modules_without_native_tests_in_multi_module_builds"></a>Skip modules without native tests in multi-module builds</h4>
1646
+
<divclass="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
+
<divclass="paragraph">
1650
+
<p>Skip test execution for modules by configuring the <code><failNoTests></code> configuration option for the full build and then overriding it in modules where the default behavior is not desired.</p>
1651
+
</div>
1652
+
<divclass="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
+
<divclass="paragraph">
1656
+
<p>For sub-modules that do not contain native tests but should not fail the build, add this to the module’s <em>pom.xml</em> in the module in the <code><plugins></code> section:</p>
<p>and then override this in any sub-module that should have native tests by adding this to the module in the <code><plugins></code> section:</p>
0 commit comments