如何修复“在当前项目和插件组中找不到前缀‘liquibase’的插件”

Eup*_*uph 5 java liquibase maven spring-boot

我是 Liquibase 的新手。我已经将 maven 插件和 liquibase 包含到我的 pom.xml 中,但是当我使用更新 liquibase 时出现mvn liquibase:update此错误:

No plugin found for prefix 'liquibase' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] 
Run Code Online (Sandbox Code Playgroud)

如何修复此错误,以便在我键入时mvn liquibase:update它会正常运行

以下是我pom.xml与 liquibase 相关的一些依赖项

<dependency>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-core</artifactId>
</dependency>

<build>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.5</version>
        <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-maven-plugin</artifactId>
        <version>3.6.3</version>
        <configuration>
            <propertyFile>src/main/resources/liquibase.properties</propertyFile>
            <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
        </configuration>
    </plugin>
</build>
Run Code Online (Sandbox Code Playgroud)

hts*_*ame 17

我认为问题不在于 liquibase 插件本身。它更多地是关于 Maven 前缀的。

尝试执行: mvn org.liquibase:liquibase-maven-plugin:update

另外,看看这个问题


小智 5

执行mvn liquibase:update命令时,请确保您在正确的路径中。并尝试在单独的终端(如命令提示符)中运行该命令。在我的情况下,当我遇到问题时,我在 IntelliJ IDEA 中使用终端,但是当我在不同的终端中尝试时,它工作得很好。