Unable to execute test from Jenkins

776 views
Skip to first unread message

skrn...@gmail.com

unread,
Nov 10, 2015, 6:24:57 AM11/10/15
to Jenkins Users
Hello Guys,

I'm facing issue with jenkins (Jenkins ver. 1.636) where my tests are not running and fail with compail issues.Just i created simple mvn project (with testng) and created job in jenkins. The Projects works file locally and jenkins error and pom below 

Note: From mange jenkins i pointed jdk to 1.7



this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test.jenkins 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test.jenkins ---
[INFO] Deleting C:\Program Files (x86)\Jenkins\workspace\myproject\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test.jenkins ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\myproject\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ test.jenkins ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test.jenkins ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\myproject\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ test.jenkins ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Program Files (x86)\Jenkins\workspace\myproject\target\test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ test.jenkins ---
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.325 s
[INFO] Finished at: 2015-11-10T16:51:07+05:30
[INFO] Final Memory: 18M/224M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project test.jenkins: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\myproject\pom.xml to test.jenkins/test.jenkins/0.0.1-SNAPSHOT/test.jenkins-0.0.1-SNAPSHOT.pom
channel stopped
Finished: FAILURE


pom.xml

  <modelVersion>4.0.0</modelVersion>
  <groupId>test.jenkins</groupId>
  <artifactId>test.jenkins</artifactId>
  <version>0.0.1-SNAPSHOT</version>
<dependencies>
  <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.1.1</version>
        <scope>compile</scope>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
           <version>3.3</version>
             <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
               <version>2.16</version>
                </configuration> -->
            </plugin> 
    </plugins>
</build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <!-- <version>2.19</version> -->
      </plugin>
    </plugins>
  </reporting>
</project>

skrn...@gmail.com

unread,
Nov 11, 2015, 10:27:14 AM11/11/15
to Jenkins Users
Guys,

Please help me in these issue or let me know if any information required.

Karl Heinz Marbaise

unread,
Nov 11, 2015, 10:32:45 AM11/11/15
to jenkins...@googlegroups.com
Hi,

On 11/11/15 4:27 PM, skrn...@gmail.com wrote:
>
> this reason, future Maven versions might no longer support building
> such malformed projects. [WARNING] [INFO]

The warning which is above this has some important information in it...I
assume versions etc. which have not been defined...


> [INFO] ------------------------------------------------------------------------
> [INFO] Building test.jenkins 0.0.1-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO]
> [INFO]*--- maven-clean-plugin:2.5:clean (default-clean) @ test.jenkins --- *[INFO] Deleting C:\Program Files (x86)\Jenkins\workspace\myproject\target
> [INFO]
> [INFO]*--- maven-resources-plugin:2.6:resources (default-resources) @
> test.jenkins --- *[WARNING] Using platform encoding (Cp1252
> actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\myproject\src\main\resources

You should define the encoding for your build which means:

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




> [INFO]
> [INFO]*--- maven-compiler-plugin:3.3:compile (default-compile) @
> test.jenkins --- *
>
> [INFO] No sources to compile
> [INFO]
> [INFO]*--- maven-resources-plugin:2.6:testResources (default-testResources)
> @ test.jenkins --- *[WARNING] Using platform encoding (Cp1252
> actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\myproject\src\test\resources
> [INFO]
> [INFO]*--- maven-compiler-plugin:3.3:testCompile (default-testCompile) @
> test.jenkins --- *[INFO] Changes detected - recompiling the module!
> [WARNING] File encoding has not been set, using platform encoding
> Cp1252, i.e. build is platform dependent! [INFO] Compiling 1 source file to C:\Program Files (x86)\Jenkins\workspace\myproject\target\test-classes
>


How is you test named? Based on the naming conventions of
maven-surefire-plugin ?



> [INFO]
> [INFO]*--- maven-surefire-plugin:2.12.4:test (default-test) @ test.jenkins
> --- *
>
> [JENKINS] Recording test results
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 7.325 s
> [INFO] Finished at: 2015-11-10T16:51:07+05:30
>
> [INFO] Final Memory: 18M/224M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
> (default-test) on project test.jenkins: No tests were executed! (Set
> -DfailIfNoTests=false to ignore this error.) -> [Help 1] [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with


Here Maven says simply that it doesn't found any test......



> the -e switch. [ERROR] Re-run Maven using the -X switch to enable
> full debug logging. [ERROR] [ERROR] For more information about the
> errors and possible solutions, please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException <http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException>
> [JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\myproject\pom.xml to test.jenkins/test.jenkins/0.0.1-SNAPSHOT/test.jenkins-0.0.1-SNAPSHOT.pom
> channel stopped
>
> Finished: FAILURE
>
>
>
> pom.xml
>
> <project xmlns="http://maven.apache.org/POM/4.0.0
> <http://maven.apache.org/POM/4.0.0>"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> <http://www.w3.org/2001/XMLSchema-instance>"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> <http://maven.apache.org/POM/4.0.0>
> http://maven.apache.org/xsd/maven-4.0.0.xsd
You have to keep the versions of maven-surefire-plugin,
maven-failsafe-plugin and maven-surefire-report-pugin in sync which
means always use the same version....


Kind regards
Karl Heinz Marbaise

Reply all
Reply to author
Forward
0 new messages