How to run JUnit:s from Maven?
Hello!I got a project looking like this in eclipse:
myproject-folder
(src-folder) src/main/java/my.project.AClass
(src-folder) src/main/resources/some.props
(src-folder) src/main/test/my.project.AJunitTestCase
pom.xml
In the pom I just got this plugin:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
When I run mvn clean install from a terminal I get an out put like this:
...
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
...
Even though I have not specified that maven should look for tests (due to my lack of knowledge about maven), it looks like it searches for TestClasses. But it does not find any.
So my first question is how do I control Maven to run my testcases during mvn clean install?
My next question (sorry for add it in to this).
When I do mvn eclipse:eclipse, my src/main/test dissapaers as src-folder so I have to add it again as src-folder in eclipse.
Is it possible to prevent this?
Best regards
Fredrik
