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
Maven 马文;朱尼特理论_Maven_Maven 2_Maven 3 - Fatal编程技术网

Maven 马文;朱尼特理论

Maven 马文;朱尼特理论,maven,maven-2,maven-3,Maven,Maven 2,Maven 3,我想在Maven3下运行JUnit理论, 这些理论在方法之前有注释@理论 在Eclipse中运行测试没有问题 在Maven下使用Surfere插件运行它,我得到“java.lang.Exception:无可运行方法” 我该如何处理这个问题?它对我很有效。我在插件部分的配置: <plugin> <groupId>org.apache.maven.plugins</groupId> <a

我想在Maven3下运行JUnit理论, 这些理论在方法之前有注释@理论

在Eclipse中运行测试没有问题

在Maven下使用Surfere插件运行它,我得到“java.lang.Exception:无可运行方法”


我该如何处理这个问题?它对我很有效。我在插件部分的配置:

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
                            <version>2.12</version>
            <configuration>
                <includes>
                    <include>**/*Junit*.java</include>
                    <include>**/*Test*.java</include>
                    <include>**/*Test.java</include>
                    <include>**/*TestCase.java</include>
                </includes>
                <excludedGroups combine.self="override" />
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit47</artifactId>
                    <version>2.12</version>
                </dependency>
            </dependencies>
        </plugin>

org.apache.maven.plugins
maven surefire插件
2.12
**/*Junit*.java
**/*Test*.java
**/*Test.java
**/*TestCase.java
org.apache.maven.surefire
surefire-junit47
2.12

我使用了junit版本4.10,它适合我。我在插件部分的配置:

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
                            <version>2.12</version>
            <configuration>
                <includes>
                    <include>**/*Junit*.java</include>
                    <include>**/*Test*.java</include>
                    <include>**/*Test.java</include>
                    <include>**/*TestCase.java</include>
                </includes>
                <excludedGroups combine.self="override" />
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit47</artifactId>
                    <version>2.12</version>
                </dependency>
            </dependencies>
        </plugin>

org.apache.maven.plugins
maven surefire插件
2.12
**/*Junit*.java
**/*Test*.java
**/*Test.java
**/*TestCase.java
org.apache.maven.surefire
surefire-junit47
2.12

我使用了junit版本4.10

您是否配置了junit版本maven surefire插件正在使用的版本?您是否配置了junit版本maven surefire插件正在使用的版本?哦,对不起,我忘了说我尝试先用清单测试RCP应用程序,我认为运行测试应该没有什么区别。所以使用“tycho surefire插件”,我的POM看起来是这样的:org.eclipse.tycho tycho surefire插件0.13.0没问题,我没有使用tycho插件的经验。您可以始终使用
maven surefire插件
作为maven模块。我尝试使用您对maven Surfere插件和Surfere-junit47的配置,但仍然存在一个问题,即找到了测试,但没有可运行的方法。在maven下运行理论还有什么其他错误吗?问题可能是现在你们有两个插件,maven选择其中一个。创建简单的maven项目,并尝试使用
maven surefire插件版本2.12
和理论。检查include pattern哦,对不起,我忘了说我首先尝试用manifest测试RCP应用程序,我认为运行测试应该没有什么区别。所以使用“tycho surefire插件”,我的POM看起来是这样的:org.eclipse.tycho tycho surefire插件0.13.0没问题,我没有使用tycho插件的经验。您可以始终使用
maven surefire插件
作为maven模块。我尝试使用您对maven Surfere插件和Surfere-junit47的配置,但仍然存在一个问题,即找到了测试,但没有可运行的方法。在maven下运行理论还有什么其他错误吗?问题可能是现在你们有两个插件,maven选择其中一个。创建简单的maven项目,并尝试使用
maven surefire插件版本2.12
和理论。检查包含模式