在编写maven插件时如何指定允许的maven版本[关闭]

u3r8eeie  于 2024-01-06  发布在  Maven
关注(0)|答案(1)|浏览(231)

**已关闭。**此问题需要debugging details。目前不接受回答。

编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将帮助其他人回答问题。
上个月就关门了。
Improve this question

  1. mvn versions:display-plugin-updates

显示一条线

  1. Plugins require minimum Maven version of: 3.9.1


我写了一个插件,我想提供的maven版本也与它的作品,使它显示在版本插件。我怎么能这样做?

yb3bgrhw

yb3bgrhw1#

请在您的插件项目中使用prerequisites
使用相同版本的Maven Plugin API和其他Maven核心构件也是一个很好的实践。
因此,项目可以看起来像:

  1. <project>
  2. ...
  3. <packaging>maven-plugin</packaging>
  4. ...
  5. <prerequisites>
  6. <maven>${mavenVersion}</maven>
  7. </prerequisites>
  8. <properties>
  9. <mavenVersion>minimum-supported-version</mavenVersion>
  10. </properties>
  11. <dependencies>
  12. <dependency>
  13. <groupId>org.apache.maven</groupId>
  14. <artifactId>maven-plugin-api</artifactId>
  15. <version>${mavenVersion}</version>
  16. <scope>provided</scope>
  17. </dependency>
  18. <dependency>
  19. <groupId>org.apache.maven</groupId>
  20. <artifactId>maven-core</artifactId>
  21. <version>${mavenVersion}</version>
  22. <scope>provided</scope>
  23. </dependency>
  24. <dependency>
  25. ...
  26. </project>

字符串

展开查看全部

相关问题