java - How to build jars with and without test classes with Spring Boot with Maven -


i using build fat jar

        <plugin>             <groupid>org.springframework.boot</groupid>             <artifactid>spring-boot-maven-plugin</artifactid>         </plugin> 

i added this, generated *-test.jar, not include dependency, testng classes necessary running test on command line.

    <plugin>         <groupid>org.apache.maven.plugins</groupid>         <artifactid>maven-jar-plugin</artifactid>         <version>2.6</version>         <executions>             <execution>                 <goals>                     <goal>test-jar</goal>                 </goals>             </execution>         </executions>     </plugin> </plugins> 

java -classpath target/mypackage-tests.jar mytest exception in thread "main" java.lang.noclassdeffounderror: org/testng/testng ...


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -