Why tests sometimes build failed (maven-surefire-plugin)?

663 views Asked by At

In Netbeans i wrote my projects using selenium. Sometimes projects build ok, sometimes build falied. I think, the problem is in maven-sunfire-plugins. But why from 48 builds only 3-4 is failed?

In jenkins console I see:

org.apache.maven.surefire.util.SurefireReflectionException:
 java.lang.reflect.InvocationTargetException; nested exception is        
  java.lang.reflect.InvocationTargetException: null

POM file

<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>pl.com.mycompany.test</groupId>
    <artifactId>selenium-test</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>selenium-test</name>
    <url>http://maven.apache.org</url>

    <repositories>
        <repository>
            <id>central</id>
            <url>http://maven-repo.myportal.pl:3080/artifactory/repo</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>snapshots</id>
            <url>http://maven-repo.myportal.pl:3080/artifactory/repo</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>internal</id>
            <name>Archiva Managed Internal Repository</name>
            <url>http://maven-repo.myportal.pl:3080/archiva/repository/internal</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <finalName>selenium-test</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <compilerVersion>1.6</compilerVersion>
                    <source>1.6</source>
                    <target>1.6</target>
                    <!--<encoding>Cp1250</encoding> -->
                    <encoding>UTF-8</encoding>
                    <!--<encoding>ISO-8859-2</encoding> -->
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>oracle</groupId>
            <artifactId>ojdbc</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>

        <!-- Selenium -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.43.1</version>
        </dependency>
        <dependency>
            <groupId>pl.com.mycompany.selenium.util</groupId>
            <artifactId>selenium-listener</artifactId>
            <version>RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.11</version>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.6.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>pl.com.mycompany.portal</groupId>
            <artifactId>commons-portal</artifactId>
            <version>RELEASE</version>
        </dependency>

        <dependency>
            <groupId>weblogic</groupId>
            <artifactId>weblogic</artifactId>
            <version>8.0</version>
        </dependency>

        <!-- TESTS -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <!-- -->
    <profiles>
        <profile>
            <id>2db</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.11</version>
                        <configuration>
                            <properties>
                                <property>
                                    <name>listener</name>
                                    <value>pl.com.mycompany.selenium.util.TestNgRunSuiteListener</value>
                                </property>
                            </properties>
                            <systemProperties>
                                <property>
                                    <name>job_name</name>
                                    <value>${project.artifactId}</value>
                                </property>
                            </systemProperties>

                            <testFailureIgnore>true</testFailureIgnore>

                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Oddest is it a lot of builds its okey. From 48 builds only 3 throw this and I don't understand why. Where is error?

0

There are 0 answers