Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 第谷跳过测试_Java_Maven_Junit_Tycho_Maven Surefire Plugin - Fatal编程技术网

Java 第谷跳过测试

Java 第谷跳过测试,java,maven,junit,tycho,maven-surefire-plugin,Java,Maven,Junit,Tycho,Maven Surefire Plugin,我的项目使用maven进行构建,但在安装过程中,它总是跳过测试。如果我使用-X,它会告诉我: [DEBUG] (f) skipTests = true 这是从哪里来的?这是我的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

我的项目使用maven进行构建,但在安装过程中,它总是跳过测试。如果我使用-X,它会告诉我:

[DEBUG]   (f) skipTests = true
这是从哪里来的?这是我的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>

4.0.0
项目
eclipse测试插件
项目
父母亲
1.0.0
朱尼特
朱尼特
3.8.1
org.eclipse.tycho
tycho maven插件
${tycho版本}
真的
org.apache.maven.plugins
maven surefire插件
2.19.1
假的

如果有任何日志或其他文件可以帮助我找到原因,请告诉我。

1-使用tycho surefire插件而不是maven surefire插件

2-您必须为测试定义目标平台配置

3-可以找到所有tycho surefire插件参数

例如:

<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>

org.eclipse.tycho
第谷surefire插件
${tycho.version}
默认测试
集成测试
测试
-Xmx1024m
-Dosgi.arch=x86
假的
假的
目标平台配置:

  <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>

org.eclipse.tycho
目标平台配置
${tycho.version}
win32
win32
x86
linux
gtk
x86
linux
gtk
x86_64
忽视
eclipse插件
org.eclipse.ui
0.0.0
eclipse插件
org.eclipse.ui.views
0.0.0
.....

希望这有帮助。

谢谢,这有帮助:-)