Maven SureFire插件和Maven SureFire依赖关系有什么区别

发布于 2025-01-31 19:56:47 字数 389 浏览 5 评论 0原文

maven surefire插件

[...] org.apache.maven.plugins 毛门 - 塞普林 3.0.0-m6 [...]

maven surefire依赖性

 < groupid> org.apache.maven.plugins</groupid>
< artifactid> maven-surefire-plugin</artifactid>
<版本> 3.0.0-m5</version> </depentency>
 

SureFire插件和依赖关系有什么区别?

Maven Surefire Plugin

[...]

org.apache.maven.plugins
maven-surefire-plugin
3.0.0-M6

[...]

Maven Surefire dependency

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version> </dependency>

what is the difference between the surefire plugin and dependency?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤檠 2025-02-07 19:56:47

如果要在构建过程中运行测试,请使用SureFire插件作为插件。

我认为没有立即使用它作为依赖性。

If you want to run tests during build, use the surefire plugin as plugin.

I see no immediate use case for using it as dependency.

时光磨忆 2025-02-07 19:56:47

如果您只使用SureFire插件依赖项而没有提及它的类型,则仅位于罐子列表下。而如果您在插件下使用它,或者指定了它的类型,则可能会帮助您进行单元测试和报告生成并与其他测试框架集成。
因此,如果要添加依赖关系,则应像以下那样添加

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.0.0-M6</version>
  <type>maven-plugin</type>
</dependency>

If you just use surefire plugin dependency without mentioning the type of it, it just lies under your jars list. Whereas If you use it under plugins or If you specify the type of it then it may help you for unit testing and report generation and to get integrated with other testing frameworks.
So If you are adding a dependency, you should add it like below

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.0.0-M6</version>
  <type>maven-plugin</type>
</dependency>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文