Как добавить основную конфигурацию ArgLine вместо конфигурации исполнения? - PullRequest
0 голосов
/ 05 февраля 2020
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <skip>${skipUnitTestDir}</skip>
        <systemProperties>
            <property>
                <name>user.timezone</name>
                <value>GMT-07:00</value>
            </property>
            <property>
                <name>user.language</name>
                <value>en</value>
            </property>
            <property>
                <name>user.country</name>
                <value>US</value>
            </property>
        </systemProperties>
        <environmentVariables>
            <ks>${project.build.directory}/test-classes</ks>
            <ksp>${project.build.directory}/test-classes</ksp>
        </environmentVariables>
        <argLine>${argLine} -Xms512m -Xmx1024m -Dtestng.report.xml.name=${maven.build.timestamp}.xml</argLine>
    </configuration>
    <executions>
        <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
                <goal>test</goal>
            </goals>
            <configuration>
                <!--<argLine>${argLine} -Xms512m -Xmx1024m -Dtestng.report.xml.name=testng-results-no-tests.xml</argLine>-->
                <suiteXmlFiles>
                    <suiteXmlFile>testng-no-tests.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </execution>
        <execution>
            <id>it-test</id>
            <phase>test</phase>
            <goals>
                <goal>test</goal>
            </goals>
            <configuration>
                <!--<argLine>${argLine} -Xms512m -Xmx1024m -Dtestng.report.xml.name=testng-results-production-tests-pro.xml</argLine>-->
                <skip>${skipITSuite}</skip>
                <suiteXmlFiles>
                    <suiteXmlFile>testng-no-tests.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </execution>
    </executions>
</plugin>

Я пытаюсь установить -Dtestng.report. xml .name со значением временной отметки. Но это значение временной метки не изменится при использовании внутри ArgLine. Мне нужен этот ArgLine для выполнения отчета по тестам. Как я могу установить значение -Dtestng.report. xml .name динамически, отметку времени при создании отчета? Как я могу это сделать?

...