简体   繁体   中英

Can't find Flyway maven plugin

In my pom.xml, I have:

 <plugin>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-maven-plugin</artifactId>
    <version>3.1</version>
    <configuration></configuration>
 </plugin>

to test the plugin, I'm doing:

mvn flyway:migrate

But I get an error:

[ERROR] No plugin found for prefix 'flyway' in the current project and in the pl
ugin groups [org.wildfly.plugins, org.flywaydb.plugins, org.apache.maven.plugins
, org.codehaus.mojo] available from the repositories [local (C:\Users\me\.
m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

What am I missing from my pom? the flyway plugin IS in central.

You should run mvn compile flyway:migrate inside your project class path.

Suppose your has a project name bar that store inside C:\\project directory.

  • You should open command prompt and change change directories to C:\\project\\bar .
  • Then, Run mvn compile flyway:migrate instead of use mvn flyway:migrate

See also, First Steps: flywaydb with Maven

In my case it says: DataSource not set! Check your configuration! You should fill configuration tag:

<plugin>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-maven-plugin</artifactId>
        <version>4.0.1</version>
        <configuration>
            <url>jdbc:h2:file:./target/foobar</url>
            <user>sa</user>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.4.191</version>
            </dependency>
        </dependencies>
    </plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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