lundi 29 février 2016

Maven does not find unit tests to run, no Junit tests are executed Java

When run mvn clean install my project builds successfully howver it does not run any unit tests I have set up.

Here is the console output:

------------------------------------------------------- T E S T S

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] [INFO] --- exec-maven-plugin:1.1:exec (generate-output) @ print-engine-tester --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ print-engine---

Here is my pom:

<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/HBk9RF">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.r.cg.fs.tools</groupId>
        <artifactId>tools</artifactId>
        <version>2.8.1-SNAPSHOT</version>
    </parent>

    <artifactId>print-engine-tester</artifactId>
    <name>FPS Print Engine (Regression) Tester App</name>

    <dependencies>
        <dependency>
            <groupId>com.r.cg.fs.common</groupId>
            <artifactId>build-utility</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.r.cg.fs.engines</groupId>
            <artifactId>print-engine</artifactId>
              <exclusions>
                <exclusion>
                  <groupId>org.testng</groupId>
                  <artifactId>testng</artifactId>
                </exclusion>
              </exclusions>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>



    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-dependencies</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.r.cg.fs.content.ty13</groupId>
                                    <artifactId>fps-production-content-bundle</artifactId>
                                    <version>2013.42-SNAPSHOT</version>
                                    <type>zip</type>
                                    <outputDirectory>target</outputDirectory>
                                    <includes>**/*.*</includes>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.r.cg.fs.content</groupId>
                                    <artifactId>tt-production-content</artifactId>
                                    <version>2012.0.0-SNAPSHOT</version>
                                    <classifier>bin</classifier>
                                    <type>zip</type>
                                    <outputDirectory>target</outputDirectory>
                                    <includes>**/*.zip</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
                    <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>build-helper-maven-plugin</artifactId>
              <version>1.10</version>
              <executions>
                <execution>
                  <id>add-resource</id>
                  <phase>generate-test-resources</phase>
                  <goals>
                    <goal>add-test-resource</goal>
                  </goals>
                  <configuration>
                    <resources>
                      <resource>
                        <directory>${project.build.directory}/pdf-content</directory>
                        <!-- <targetPath>/pdf-content</targetPath> -->
                      </resource>
                    </resources>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-output</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>generate-output</id>
                        <phase>test</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>java</executable>
                            <classpathScope>test</classpathScope>
                            <arguments>
                                <argument>-Dfps.root.dir=target/pdf-content</argument>
                                <argument>-classpath</argument>
                                <classpath />
                                <argument>PrintEngineTester</argument>
                                <argument>target/pdf-content</argument>
                                <argument>target/pdf-content/fonts</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12</version>
                <configuration>
                    <systemProperties>
                        <property>
                            <name>fileName</name>
                            <value>${fileName}</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>     
        </plugins>
    </build>

    <!-- Need "central" for resolving parent artifact -->
    <repositories>
        <repository>
            <id>central</id>
            <name>r Central Repository</name>
            <url>http://ift.tt/1OJXqnq;
            <snapshots>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

</project>

Aucun commentaire:

Enregistrer un commentaire