7

I am new to Liquibase. I have already included maven plugins and liquibase to my pom.xml however when i update liquibase using mvn liquibase:update I get this error:

No plugin found for prefix 'liquibase' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] 

How can I fix this error so that when I type mvn liquibase:update it will run properly

Here are some of the dependencies that are in my pom.xml related to 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>
htshame
  • 6,599
  • 5
  • 36
  • 56
Euph
  • 339
  • 1
  • 4
  • 19

4 Answers4

26

I don't think the problem is with liquibase plugin itself. It's more about maven prefixes.

Try executing: mvn org.liquibase:liquibase-maven-plugin:update

Also, check out this question.

Community
  • 1
  • 1
htshame
  • 6,599
  • 5
  • 36
  • 56
8

Make sure you are in the right path when you are executing mvn liquibase:update command. And also try to run the command in a separate terminal like command prompt. In my case I'm using the terminal in IntelliJ IDEA when I had the problem but when I tried it in different terminal, it worked flawlessly.

emarkyuu
  • 96
  • 1
  • 2
3

In my case problem was in path. I was trying to start command c:\mvn.cmd liquibase:status from wrong folder.

Running from c:\projects\My_current_project\mvn liquibase:status works like a charm. c:\projects\My_current_project\ is folder, where pom.xml is.

Mike Menko
  • 819
  • 8
  • 9
1

In my case the issue was my pom is configured in such a way that the liquibase plugin is only defined under certain profiles which need to be passed in before the mvn liquibase:<your command here> gets run.

for example, if the pom.xml has a local profile and your liquibase plugin is ONLY defined under that profile, you should run something like mvn -P local liquibase:update in order for maven to pick up liquibase (since it's only defined in that profile)