Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Maven config options that may be relevant when running tests #35211

Merged
merged 1 commit into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/src/main/asciidoc/maven-tooling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,58 @@

More information on this topic can be found on the xref:cdi-reference.adoc#bean_discovery[Bean Discovery] section of the CDI guide.

[[maven-test-configuration]]
=== Maven test plugin configuration

`maven-surefire-plugin` and `maven-failsafe-plugin` configurations showed above will work in most cases. However, there could be cases when extra configuration will be required.

The reason is that, Quarkus may need to re-resolve application dependencies during the test phase to set up the test classpath for the tests. The original Maven resolver used in previous build phases

Check warning on line 645 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'might (for possiblity)' or 'can (for ability)' rather than 'may' unless updating existing content that uses it. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'might (for possiblity)' or 'can (for ability)' rather than 'may' unless updating existing content that uses it.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 645, "column": 16}}}, "severity": "WARNING"}

Check warning on line 645 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 645, "column": 20}}}, "severity": "INFO"}
will not be available in the test process and, as a conseqence, Quarkus will need to initialize a new one. To make sure the new resolver is initialized correctly, the relevant configuration options

Check warning on line 646 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Spelling] Use correct American English spelling. Did you really mean 'conseqence'? Raw Output: {"message": "[Quarkus.Spelling] Use correct American English spelling. Did you really mean 'conseqence'?", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 646, "column": 40}}}, "severity": "WARNING"}

Check warning on line 646 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 646, "column": 65}}}, "severity": "INFO"}

Check warning on line 646 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'verify' rather than 'make sure' unless updating existing content that uses it. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'verify' rather than 'make sure' unless updating existing content that uses it.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 646, "column": 98}}}, "severity": "WARNING"}

Check warning on line 646 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 646, "column": 191}}}, "severity": "INFO"}
will need to be passed to the test process.

==== Maven user settings

Check warning on line 649 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[Quarkus.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 649, "column": 14}}}, "severity": "INFO"}

A path to the Maven user settings file may need to be passed to test processes, for example, in case the Maven build process was not launched using the default `mvn` scripts included in the Maven distribution.

Check warning on line 651 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsWarnings] Consider using 'might (for possiblity)' or 'can (for ability)' rather than 'may' unless updating existing content that uses it. Raw Output: {"message": "[Quarkus.TermsWarnings] Consider using 'might (for possiblity)' or 'can (for ability)' rather than 'may' unless updating existing content that uses it.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 651, "column": 27}}}, "severity": "WARNING"}

Check warning on line 651 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'. Raw Output: {"message": "[Quarkus.Fluff] Depending on the context, consider using 'Rewrite the sentence, or use 'must', instead of' rather than 'need to'.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 651, "column": 31}}}, "severity": "INFO"}
It could be done in the following way:

[source,xml,subs=attributes+]
----
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<!-- skip -->
<maven.settings>${session.request.userSettingsFile.absolutePath}</maven.settings>
</systemPropertyVariables>
</configuration>
</plugin>
----

==== Remote repository access through authenticated HTTPS

Check warning on line 669 in docs/src/main/asciidoc/maven-tooling.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [Quarkus.TermsSuggestions] Depending on the context, consider using '' - ' (range)', 'by using', 'finished', or 'completed' rather than 'through'. Raw Output: {"message": "[Quarkus.TermsSuggestions] Depending on the context, consider using '' - ' (range)', 'by using', 'finished', or 'completed' rather than 'through'.", "location": {"path": "docs/src/main/asciidoc/maven-tooling.adoc", "range": {"start": {"line": 669, "column": 14}}}, "severity": "INFO"}

In case a remote Maven repository requires link:https://maven.apache.org/guides/mini/guide-repository-ssl.html[authenticated HTTPS access configuration], some or all of the following properties will need to be passed to the test plugins:

[source,xml,subs=attributes+]
----
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<!-- skip -->
<javax.net.ssl.keyStoreType>${javax.net.ssl.keyStoreType}</javax.net.ssl.keyStoreType>
<javax.net.ssl.keyStore>${javax.net.ssl.keyStore}</javax.net.ssl.keyStore>
<javax.net.ssl.keyStorePassword>${javax.net.ssl.keyStorePassword}</javax.net.ssl.keyStorePassword>
<javax.net.ssl.trustStore>${javax.net.ssl.trustStore}</javax.net.ssl.trustStore>
<javax.net.ssl.trustStorePassword>${javax.net.ssl.trustStorePassword}</javax.net.ssl.trustStorePassword>
</systemPropertyVariables>
</configuration>
</plugin>
----

[[maven-configuration-profile]]
=== Building with a specific configuration profile

Expand Down