maven - 在pom.xml中找到ID为default的重复执行

标签 maven pom.xml execution

如何解决重复执行的问题。

'build.pluginManagement.plugins.plugin[org.flywaydb:flyway-maven-plugin].executions.execution.id' must be unique but found duplicate execution with id default



这是源代码:
             <plugin>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-maven-plugin</artifactId>
                <version>4.0.1</version>
                <configuration>
                    <user>tkmadmin</user>
                    <password>ticketmaster</password>
                </configuration>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>migrate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

最佳答案

在您的<id>中添加明确的<execution>:

<execution>
    <id>flyway-clean</id>
...
<execution>
    <id>flyway-migrate</id>

引用:Maven / POM Reference, Plugins:

  • executions: ...

    ...
    
  • id: Self explanatory. It specifies this execution block between all of the others. When the phase is run, it will be shown in the form: [plugin:goal execution: id].

关于maven - 在pom.xml中找到ID为default的重复执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37654149/

相关文章:

java - 如何在 maven-shade-plugin 创建的 Jar 中包含测试类?

java - 如何获取运行 Maven 的机器的临时文件夹?

maven - 使用wildfly-maven-plugin创建安全域没有效果

linux - 内存访问权限,需要从堆栈执行代码。如何验证系统权限?

linux - 执行文件的问题

java - Maven Shade 插件 - NoClassDefFounderror

在 ubuntu 上的 eclipse 中使用 maven 的 hadoop 核心的 javadocs 和源代码

Java的Process.exec,有没有更好的处理方法?

java - 如何使用 Maven 自动化多个构建?

maven - Maven 中的 pom.properties 自定义