从pom传递mvn测试参数
Passing parameter for mvn test from pom
我有一个带测试的springboot项目
我想通过 mvn 测试的参数很少(例如密码、密码等),我知道这可以通过 cli 中的 -D 选项来完成。这些值可以从 pom.xml 传递吗?
下面似乎没有工作,我猜这是为了执行而不是为了编译
<properties>
<someproperty> abcd </someproperty>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -Dsomeproperty=someValue </argLine>
</configuration>
</plugin>
这成功了。
回答我的问题以防其他人需要这个
我有一个带测试的springboot项目 我想通过 mvn 测试的参数很少(例如密码、密码等),我知道这可以通过 cli 中的 -D 选项来完成。这些值可以从 pom.xml 传递吗? 下面似乎没有工作,我猜这是为了执行而不是为了编译
<properties>
<someproperty> abcd </someproperty>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -Dsomeproperty=someValue </argLine>
</configuration>
</plugin>
这成功了。 回答我的问题以防其他人需要这个