简体   繁体   English

在Maven扩展中可以添加 <configuration> 像我们对插件所做的那样阻止pom.xml中的内容?

[英]In Maven extensions is it possible to add <configuration> block in the pom.xml like we do for plugins?

We have a Maven extension which does some post actions at the end of build, but we want to extended its features by adding some flags/properties/something else in <configuration> block same as the way we do for plugin configurations in pom.xml . 我们有一个Maven扩展,它在构建结束时执行一些后期操作,但是我们想通过在<configuration>块中添加一些标志/属性/其他内容来扩展其功能,这与在pom.xml进行插件配置的方式相同。 Is it possible to do that? 有可能这样做吗?

We tried adding it in pom.xml but it is throwing exceptions during build, also didn't managed find it in the docs. 我们尝试将其添加到pom.xml但是在构建过程中它引发了异常,也没有在文档中找到它。

Want to have something like below in the pom.xml : 想要在pom.xml具有以下内容:

<build>
  ...
  <extensions>
    ...
    <extension>
      <groupId>org.apache.maven.extensions</groupId>
      <artifactId>maven-test-extension</artifactId>
      <version>1.0-SNAPSHOT</version>
      <configuration>
        ....
      </configuration>
    </extension>
    ...
  </extensions>
  ...
</build>

我们以不同的方式进行了尝试,我们使用pom.xml中的<extention>true</extension>将扩展配置为插件,并且接受<configuration>....</configuration>块。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM