java - Executing Main Class through pom.xml -
guys know asking silly question, curious why test not running.
i have created simple maven project(no junits, etc simple main class) 1 main class in test folder , trying execute same through pom.xml.
i have gone through existing question's on here didn't resolve it
when try execute got following output.
running samplemav.testone tests run: 0, failures: 0, errors: 0, skipped: 0, time elapsed: 0.015 sec pom.xml
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>samplemav</groupid> <artifactid>samplemav</artifactid> <version>0.0.1-snapshot</version> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.20</version> <configuration> <includes> <include>samplemav.testone</include> </includes> </configuration> </plugin> </plugins> </build> java class
package samplemav; public class testone { public static void main(string args[]){ system.out.println("test"); } } regards
you may want use junit unit testing.
package samplemav; import org.junit.test; public class testone { @test public void test() { system.out.println("test"); } } and add test dependency pom.xml
<dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.11</version> <scope>test</scope> </dependency>
Comments
Post a Comment