You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christian Domsch <la...@gmail.com> on 2020/02/19 10:33:32 UTC

resolving system properties in test harness testcase

Hi,

in my plugin test case I want to inject system properties into the
execution of the test case. Reason for that is we want to run the test in
our ci environment and need to inject certain username/passwords that are
used to connect to another system.

For this I am using a SettingsStub that is configured using the following
test pom:

<project ...>

  ...

    <build>

        <plugins>

            <plugin>

                <groupId>mygroup</groupId>

                <artifactId>myartifact</artifactId>

                <version>...</version>

                <configuration>

                    <settings implementation="mypackage.SettingsStub">

                        <user>${jira.cloud.user}</user>

                        <token>${jira.cloud.password}</token>

                    </decrypter>

                </configuration>

            </plugin>

        </plugins>

    </build>

</project>


Using the SettingsStub in general works very well, but the expression is
not resolved. Digging through the code, I saw that
the org.apache.maven.plugin.testing.MojoRule (which we use) in
configureMojo uses an evaluator of class ResolverExpressionEvaluatorStub
which does not resolve the way I need it.


Is there a different way to do that, or do I need to resolve that manually
by myself (whoch I could in the SettingsStub).


Kind regards,


Christian