2016-05-04 9 views
1

Mein Projekt verwendet Maven zu bauen, aber während der Installation überspringt es immer die Tests. Wenn ich -X verwende, sagt es mir:Tycho überspringt Tests

[DEBUG] (f) skipTests = true 

Woher kommt das? Das ist mein pom:

<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> 
    <artifactId>project</artifactId> 
    <packaging>eclipse-test-plugin</packaging> 

    <parent> 
    <groupId>project</groupId> 
    <artifactId>parent</artifactId> 
    <version>1.0.0</version> 
    </parent> 
     <dependencies> 
     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>3.8.1</version> 
     </dependency> 
     </dependencies> 
    <build> 
     <plugins> 
     <plugin> 
     <groupId>org.eclipse.tycho</groupId> 
     <artifactId>tycho-maven-plugin</artifactId> 
     <version>${tycho-version}</version> 
     <extensions>true</extensions> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.19.1</version> 
     <configuration> 
      <skipTests>false</skipTests> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

Wenn es etwas einloggen oder zusätzliche Dateien i beitragen können, um die Ursache dafür zu finden, lassen Sie es mich wissen.

Antwort

1

1- tycho-surefire-plugin statt maven-surefire-plugin verwenden.

2- Sie müssen die Zielplattform-Konfiguration für den Test definieren.

<plugin> 
    <groupId>org.eclipse.tycho</groupId> 
    <artifactId>tycho-surefire-plugin</artifactId> 
    <version>${tycho.version}</version> 
    <executions> 
     <execution> 
     <id>default-test</id> 
     <phase>integration-test</phase> 
     <goals> 
      <goal>test</goal> 
     </goals> 
     </execution> 
    </executions> 
    <configuration> <!--example configuration run test in windows without GUI--> 

     <argLine>-Xmx1024m</argLine> 
     <argLine>-Dosgi.arch=x86</argLine> 
     <useUIHarness>false</useUIHarness> 
     <useUIThread>false</useUIThread> 
    </configuration> 
    </plugin> 

Ziel-Plattform-Konfiguration:

<plugin> 
      <groupId>org.eclipse.tycho</groupId> 
      <artifactId>target-platform-configuration</artifactId> 
      <version>${tycho.version}</version> 
      <configuration> 
       <environments> 
        <environment> 
         <os>win32</os> 
         <ws>win32</ws> 
         <arch>x86</arch> 
        </environment> 
        <environment> 
         <os>linux</os> 
         <ws>gtk</ws> 
         <arch>x86</arch> 
        </environment> 
        <environment> 
         <os>linux</os> 
         <ws>gtk</ws> 
         <arch>x86_64</arch> 
        </environment> 
       </environments> 
       <dependency-resolution> 
        <optionalDependencies>ignore</optionalDependencies> 
        <extraRequirements> 
         <requirement> 
          <type>eclipse-plugin</type> 
          <id>org.eclipse.ui</id> 
          <versionRange>0.0.0</versionRange> 
         </requirement> 
         <requirement> 
          <type>eclipse-plugin</type> 
          <id>org.eclipse.ui.views</id> 
          <versionRange>0.0.0</versionRange> 
         </requirement> 
         <requirement> 
          ..... 
         </requirement> 
        </extraRequirements> 
       </dependency-resolution> 
      </configuration> 
     </plugin> 

hoffe, das hilft

3- alle tycho-todsichere-Plugin Parameter können here

Beispiel gefunden werden.

+0

Danke, das hat geholfen :-) –