简体   繁体   中英

How to create single executable jar file including all main and test packages including resource files

我有一个Maven项目结构如下: -

TestNG - 7.3.0

Plugins used - maven-surefire-plugin maven-assembly-plugin

public static void main(String[] args) throws IOException {
    
    
    TestListenerAdapter tla = new TestListenerAdapter();
    TestNG testng = new TestNG(); 
    List<String> suites = Lists.newArrayList();
    String fileName = System.getProperty("user.dir")+"/src/test/resources/xmlFiles/testng12.xml";
    suites.add(fileName);
    testng.setTestSuites(suites); 
    testng.run();
}

I would like to create an executable jar file with all package like main, test packages including resources folder. maven-assembly-plugin only takes main package.

There is no TestNG library added.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM