当我试图在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) 即使我使用新提交删除了这些文件,我也无法将更改推送到具有黑名单模式的分支中。实际上,我在将更改推送到远程分支时收到以下错误。
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)
如何解决这个问题?