maven 打包testng插件 直接mvn package就行运行加testng.xml

  • Post author:
  • Post category:其他


<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-shade-plugin</artifactId>

<version>3.0.0</version>

<configuration>

<createDependencyReducedPom>false</createDependencyReducedPom>

</configuration>

<executions>

<execution>

<id>package_shade_profile</id>

<phase>package</phase>

<goals>

<goal>shade</goal>

</goals>

<configuration>

<transformers>

<transformer implementation=”org.apache.maven.plugins.shade.resource.ManifestResourceTransformer”>

<mainClass>org.testng.TestNG</mainClass>

</transformer>

</transformers>

</configuration>

</execution>

</executions>

</plugin>

</plugins>

运行时在target上层运行,运行时加入testng文件 例如java -jar target\test1.jar target\testng.xml



版权声明:本文为weixin_41167150原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。