简体   繁体   English

无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.10:test

[英]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test

I have scoured the internet for almost five days now looking for a fix to this issue, but I cannot seem to find and fix it on my own, mainly because I am so new to both Maven and PlayN so I'm not entirely sure at what I'm looking at exactly.我已经在互联网上搜索了将近五天,现在正在寻找解决此问题的方法,但我似乎无法自己找到并修复它,主要是因为我对 Maven 和 PlayN 都很陌生,所以我不完全确定我在看什么。 But, it is clearly fizzing up at building the core.但是,它显然在构建核心方面陷入困境。 Seems it can't download an "artifact filter", and is unable to run Surefire's test.似乎无法下载“神器过滤器”,也无法运行 Surefire 的测试。 But, I'm just speculating on things I don't quite understand fully, even though I've been trying to research these things like crazy.但是,我只是在猜测我不太完全理解的东西,尽管我一直在疯狂地研究这些东西。 Any help from more experienced people would be very, very, appreciated.来自更有经验的人的任何帮助将非常非常感谢。 I'm losing my mind on this.我对此失去了理智。

[INFO] Building Synthesis Core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ synthesis-core ---
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ synthesis-core ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] skip non existing resourceDirectory C:\Users\Josiah\synthesis\core\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) @ synthesis-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ synthesis-core ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Josiah\synthesis\core\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3:testCompile (default-testCompile) @ synthesis-core ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ synthesis-core ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Synthesis Metaproject ............................. SUCCESS [1.059s]
[INFO] Synthesis Core .................................... FAILURE [3.538s]
[INFO] Synthesis Java .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.997s
[INFO] Finished at: Wed Oct 31 23:57:38 EDT 2012
[INFO] Final Memory: 6M/109M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project synthesis-core: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 (): Failed to read artifact descriptor for org.apache.maven.shared:maven-common-artifact-filters:jar:1.3: Could not transfer artifact org.apache.maven.shared:maven-common-artifact-filters:pom:1.3 from/to central (http://repo.maven.apache.org/maven2): Remotely Closed [id: 0x0847a8f3, /192.168.1.54:65153 :> repo.maven.apache.org/93.184.215.223:80] -> [Help 1]

I then had it to print the whole debug logging, and it elaborated a bit on the Surefire bit, displaying all of the Exceptions invoked:然后我让它打印整个调试日志,并详细阐述了 Surefire 位,显示所有调用的异常:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
10:test (default-test) on project synthesis-core: Execution default-test of goal
 org.apache.maven.plugins:maven-surefire-plugin:2.10:test failed: Plugin org.apa
che.maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could no
t be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven
-surefire-plugin:jar:2.10 (): Failed to read artifact descriptor for org.apache.
maven.shared:maven-common-artifact-filters:jar:1.3: Could not transfer artifact
org.apache.maven.shared:maven-common-artifact-filters:pom:1.3 from/to central (h
ttp://repo.maven.apache.org/maven2): Connection reset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on projec
t synthesis-core: Execution default-test of goal org.apache.maven.plugins:maven-
surefire-plugin:2.10:test failed: Plugin org.apache.maven.plugins:maven-surefire
-plugin:2.10 or one of its dependencies could not be resolved: Failed to collect
 dependencies for org.apache.maven.plugins:maven-surefire-plugin:jar:2.10 ()
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:225)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-t
est of goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test failed: Plu
gin org.apache.maven.plugins:maven-surefire-plugin:2.10 or one of its dependenci
es could not be resolved: Failed to collect dependencies for org.apache.maven.pl
ugins:maven-surefire-plugin:jar:2.10 ()
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:82)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
        ... 19 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.
maven.plugins:maven-surefire-plugin:2.10 or one of its dependencies could not be
 resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-sur
efire-plugin:jar:2.10 ()
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
solve(DefaultPluginDependenciesResolver.java:211)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPlug
inRealm(DefaultMavenPluginManager.java:353)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPlugi
nRealm(DefaultMavenPluginManager.java:321)
        at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(Defa
ultBuildPluginManager.java:175)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:78)
        ... 20 more
Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed
to collect dependencies for org.apache.maven.plugins:maven-surefire-plugin:jar:2
.10 ()
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectD
ependencies(DefaultDependencyCollector.java:258)
        at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDepe
ndencies(DefaultRepositorySystem.java:308)
        at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
solve(DefaultPluginDependenciesResolver.java:199)
        ... 24 more
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to
 read artifact descriptor for org.apache.maven.shared:maven-common-artifact-filt
ers:jar:1.3
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:296)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(
DefaultDependencyCollector.java:412)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(
DefaultDependencyCollector.java:544)
        at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectD
ependencies(DefaultDependencyCollector.java:240)
        ... 26 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not
 transfer artifact org.apache.maven.shared:maven-common-artifact-filters:pom:1.3
 from/to central (http://repo.maven.apache.org/maven2): Connection reset
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:538)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:216)
        at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
fact(DefaultArtifactResolver.java:193)
        at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:281)
        ... 30 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not tra
nsfer artifact org.apache.maven.shared:maven-common-artifact-filters:pom:1.3 fro
m/to central (http://repo.maven.apache.org/maven2): Connection reset
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:951)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:941)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:669)
        at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(Run
nableErrorForwarder.java:60)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.wagon.TransferFailedException: Connection reset
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:799)
        at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:11
6)
        at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
        at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
        at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:601)
        ... 4 more
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:168)
        at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
        at org.apache.maven.wagon.providers.http.httpclient.impl.io.SocketInputB
uffer.fillBuffer(SocketInputBuffer.java:110)
        at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultRes
ponseParser.parseHead(DefaultResponseParser.java:98)
        at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractMess
ageParser.parse(AbstractMessageParser.java:252)
        at org.apache.maven.wagon.providers.http.httpclient.impl.AbstractHttpCli
entConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultCli
entConnection.receiveResponseHeader(DefaultClientConnection.java:247)
        at org.apache.maven.wagon.providers.http.httpclient.impl.conn.AbstractCl
ientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
        at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequest
Executor.doReceiveResponse(HttpRequestExecutor.java:298)
        at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequest
Executor.execute(HttpRequestExecutor.java:125)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.tryExecute(DefaultRequestDirector.java:645)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.execute(DefaultRequestDirector.java:464)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:820)
        at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:754)
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(A
bstractHttpClientWagon.java:674)
        at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:793)
        ... 8 more

EDIT: Adding in my pom.xml for analysis.编辑:添加在我的 pom.xml 中进行分析。

<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.googlecode.playn</groupId>
    <artifactId>playn-project</artifactId>
    <version>1.3.1</version>
  </parent>

  <groupId>com.hijackedlongboat</groupId>
  <artifactId>synthesis</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Synthesis Metaproject</name>

  <properties>
    <playn.version>1.3.1</playn.version>
  </properties>

  <profiles>
    <profile>
      <id>java</id>
      <activation><activeByDefault>true</activeByDefault></activation>
      <modules><module>java</module></modules>
    </profile>
    <profile>
      <id>android</id>
      <modules><module>android</module></modules>
    </profile>
    <profile>
      <id>ios</id>
      <modules><module>ios</module></modules>
    </profile>
    <profile>
      <id>html</id>
      <modules><module>html</module></modules>
    </profile>
    <profile>
      <id>flash</id>
      <modules><module>flash</module></modules>
    </profile>
  </profiles>

  <modules>
    <module>core</module>
  </modules>
</project>

EDIT 2: RESOLVED Through using the command "mvn dependency::tree" I was able to find a missing repository that wasn't being displayed on the debug and stack trace.编辑 2:已解决通过使用命令“mvn dependency::tree”,我能够找到未在调试和堆栈跟踪中显示的丢失存储库。 The missing repository was "forplay-legacy", which I then added to the pom.xml as follows:缺少的存储库是“forplay-legacy”,然后我将其添加到 pom.xml 中,如下所示:

  <repositories>
    <repository>
      <id>forplay-legacy</id>
      <url>http://forplay.googlecode.com/svn/mavenrepo</url>
    </repository>
  </repositories>

I had similar issue, I was able to solve it using -U option along with mvn command as我有类似的问题,我能够使用 -U 选项和 mvn 命令来解决它作为

mvn clean install -U

This worked for me, hope it helps.这对我有用,希望它有所帮助。

You're probably missing some dependencies.您可能缺少一些依赖项。

Locate the dependencies you're missing with mvn dependency:tree , then install them manually, and build your project with the -o (offline) option.使用mvn dependency:tree找到您缺少的mvn dependency:tree ,然后手动安装它们,并使用-o (离线)选项构建您的项目。

I had a similar problem but all answers here didn't help me.我有一个类似的问题,但这里的所有答案都没有帮助我。

For me the problem was a failing test.对我来说,问题是测试失败。 If you are doing test driven development than a failing / not implemented test shouldn't break the build.如果您正在进行测试驱动开发,那么失败/未实现的测试不应该破坏构建。 I still want my project to build.我仍然希望我的项目能够构建。

To solve this I added a configuration to surefire so that it ignores a failing test.为了解决这个问题,我向surefire添加了一个配置,以便它忽略失败的测试。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19.1</version>
    <configuration>
        <testFailureIgnore>true</testFailureIgnore>
    </configuration>
</plugin>

This error occurs if some unit test cases are failing.如果某些单元测试用例失败,则会发生此错误。

In my application, certain unit tests were not compatible with Java 8 so they were failing.在我的应用程序中,某些单元测试与 Java 8 不兼容,因此它们失败了。 My error was resolved after changing jdk1.8.0_92 to jdk1.7.0_80 .jdk1.8.0_92更改为jdk1.7.0_80后,我的错误得到解决。

The build would succeed with mvn clean install -DskipTests but this will skip the unit tests.构建将通过mvn clean install -DskipTests成功,但这将跳过单元测试。 So just ensure that you run then separately after the build is complete.因此,只需确保在构建完成后单独运行即可。

Update the Maven project:更新 Maven 项目:

Steps:脚步:

  1. Right-click on "project"右键单击“项目”
  2. Go to "Maven" >> "Update"转到“Maven”>>“更新”
  3. Wait for all the changes to be applied等待所有更改应用
  4. Commit the changes (if code is on repo)提交更改(如果代码在 repo 上)
  5. Run跑步

I tried following instructions given in most of the comments on this thread, including the chosen answer but the error persisted.我尝试按照该线程的大多数评论中给出的说明进行操作,包括选择的答案,但错误仍然存​​在。 I did some research and found this page that gave a solution that helped me out (okay, with some guessing though of my part).我做了一些研究,发现这个页面提供了一个帮助我的解决方案(好吧,虽然我有一些猜测)。

So what I did is that I replaced the version number in the maven surefire plugin as follows: <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M1</version>所以我所做的是将 maven surefire 插件中的版本号替换如下: <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M1</version>

I hope this helps!我希望这有帮助!

我遇到了同样的错误,但就我而言,删除/target文件夹和nbactions.xml文件后问题得到解决。

I had same issue, I resolved from below steps:我有同样的问题,我从以下步骤解决:

  1. Right click on project->maven->Update project右键单击项目-> maven-> 更新项目
  2. Here I selected "force update for snapshot/release"在这里我选择了“强制更新快照/发布”
  3. After that I compiled again my project and issue got fixed之后我再次编译了我的项目并解决了问题

When I encountered the problem, the changes.xml document was malformed (missing an end tag).当我遇到问题时, changes.xml文档格式错误(缺少结束标记)。 The fix was to edit the XML to make it well formed.解决方法是编辑 XML 以使其格式良好。

So checking that the XML is well formed can be important, especially when the release plugin does not complain about it.所以检查 XML 格式是否正确很重要,尤其是当发布插件没有抱怨它时。

For me changing the Jenkins version helped.对我来说,更改 Jenkins 版本有帮助。

  <parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>1.642.4</version><!-- which version of Jenkins is this plugin built against? -->
  </parent>

Sometimes you get similar sounding errors but for reasons that're really not related to the tools - in this case Surefire plugin.有时您会遇到类似的声音错误,但原因与工具无关 - 在这种情况下是 Surefire 插件。

For me I was getting a similar error but the reason was i wasn't pointing to the correct DB url !对我来说,我遇到了类似的错误,但原因是我没有指向正确的数据库 url!

Among a lot of verbosity (using mvn -X flag) I saw a timeout message.在很多冗长(使用 mvn -X 标志)中,我看到了一条超时消息。

One trick I did was to install IntelliJ on the build server (for debugging purpose) and fixing problems through it first and then uninstalling it and making sure everything works on build server as well.我做的一个技巧是在构建服务器上安装 IntelliJ(用于调试目的)并首先通过它解决问题,然后卸载它并确保一切都在构建服务器上正常运行。

右键单击项目 -> Maven -> 更新项目 -> 选择强制更新快照

Or要么

Navigate to project root folder and use following commands :导航到项目根文件夹并使用以下命令:

mvn clean install -U or mvn clean install --update-snapshots mvn clean install -U 或 mvn clean install --update-snapshots

Here -U will Forces a check for missing releases and updated snapshots on remote repositories这里 -U 将强制检查远程存储库上丢失的版本和更新的快照

I had a similar problem, and the solution for me was quite different from what the other users posted.我有一个类似的问题,我的解决方案与其他用户发布的完全不同。

The problem with me was related to the project I was working last year, which required a certain proxy on maven settings (located at <path to maven folder>\\maven\\conf\\settings.xml and C:\\Users\\<my user>\\.m2\\settings.xml ).我的问题与我去年工作的项目有关,该项目需要在 maven 设置上使用某个代理(位于<path to maven folder>\\maven\\conf\\settings.xmlC:\\Users\\<my user>\\.m2\\settings.xml )。 The proxy was blocking the download of required external packages.代理阻止下载所需的外部包。

The solution was to put back the original file ( settings.xml ) on those places.解决方案是将原始文件 ( settings.xml ) 放回这些地方。 Once things were restored, I was able to download the packages and everything worked.一旦事情恢复,我就可以下载软件包并且一切正常。

please follow this tutorial: https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/请遵循本教程: https : //www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.15</version>
<configuration>
    <!-- Sets the VM argument line used when unit tests are run. -->
    <argLine>${surefireArgLine}</argLine>
    <!-- Skips unit tests if the value of skip.unit.tests property is true -->
    <skipTests>${skip.unit.tests}</skipTests>
    <!-- Excludes integration tests when unit tests are run. -->
    <excludes>
        <exclude>**/IT*.java</exclude>
    </excludes>
</configuration>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在特定类上运行Maven测试-[错误]无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.10:test - Running maven test on a specific class - [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.10:test没有执行任何测试 - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test no tests were executed 未能执行目标 org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test 无法执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test on project XYZ - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test on project XYZ 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test 无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.16:SAKAI中的测试错误 - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test error in SAKAI 未能执行目标 org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test testng meaven - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test testng meaven org.apache.maven.lifecycle.LifecycleExecutionException:无法执行目标org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test - org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test 无法为 Intellij 中的 Maven 项目执行目标 org.apache.maven.plugins:maven-surefire-plugin - Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin for a maven project in Intellij
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM