小编dev*_*wan的帖子

如果没有至少一个TestEngine,则无法创建启动器; 考虑在Junit 5中将引擎实现JAR添加到类路径中

当我试图在junit5中运行测试用例时,我得到了以下execption:

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project CRUD-App: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test failed: There was an error in the forked process
org.junit.platform.commons.util.PreconditionViolationException: Cannot create Launcher without at least one TestEngine; consider adding an engine implementation JAR to the classpath
   at org.junit.platform.commons.util.Preconditions.condition(Preconditions.java:161)
   at org.junit.platform.launcher.core.DefaultLauncher.<init>(DefaultLauncher.java:52)
   at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:42)
   at org.junit.platform.surefire.provider.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:59)
   at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:286)
   at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:240)
   at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Run Code Online (Sandbox Code Playgroud)

的pom.xml

<dependencies>
    ...
    <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit5-api</artifactId>
        <version>5.0.0-SNAPSHOT</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>        
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19</version>
            <dependencies>
                <dependency>
                    <groupId>org.junit.platform</groupId>
                    <artifactId>junit-platform-surefire-provider</artifactId>
                    <version>1.0.0-M2</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins> …
Run Code Online (Sandbox Code Playgroud)

java maven junit5

24
推荐指数
4
解决办法
1万
查看次数

无法使用列入黑名单的模式推送到分支,即使我使用新提交删除了这些文件

即使我使用新提交删除了这些文件,我也无法将更改推送到具有黑名单模式的分支中。实际上,我在将更改推送到远程分支时收到以下错误。

remote: GitLab: File name domain/app-1.7.RELEASE.jar
was blacklisted by the pattern .+\.war|.+\.jar|.+\.exe|.+\.class|\.classpath|
\.project|\.settings|\.idea|.+\.iml|.+\.iws|\.flattened-pom.xml|target.

To gitlab.com:developerbhuwan/samplee.git
 ! [remote rejected]   ok-cx -> ok-cx (pre-receive hook declined)
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?

git gitlab

2
推荐指数
2
解决办法
3584
查看次数

标签 统计

git ×1

gitlab ×1

java ×1

junit5 ×1

maven ×1