- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试开始将 flyway 与 Maven 集成一起使用,但无法正常工作。
我遵循的文档似乎非常简单,所以似乎没有做任何奇怪的事情。
我的 pom.xml 如下:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<plugins>
<!-- Flyway plugin configuration -->
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<url>jdbc:mysql://localhost:3306/test</url>
<user>test_fede</user>
<password>test_fede</password>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>13.0.1</version>
</dependency>
<!-- DB dependencies -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
我的目录 resources/db/migration/ 还没有任何迁移。
当我在 cygwin 或 cmd 上发布 flyway:info 时,我遇到了 flyway 错误:
$ mvn compile flyway:info
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.test:test:jar:0.0.1-SNAPSHOT
[INFO] task-segment: [compile, flyway:info]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [flyway:info {execution: default-cli}]
[INFO] Database: jdbc:mysql://localhost:3306/test (MySQL 5.5)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.flywaydb.core.api.FlywayException: Unable to scan for SQL migrations in location: classpath:db/migration
Embedded error: Unable to determine URL for classpath location: db/migration (ClassLoader: org.codehaus.classworlds.RealmClassLoader@5bcdbf6)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Tue May 06 11:06:15 CST 2014
[INFO] Final Memory: 17M/223M
[INFO] ------------------------------------------------------------------------
可以帮我解决这个问题吗?
非常感谢。
最佳答案
如果在调用 flyway:migrate 之前未执行编译目标,也会发生这种情况。实际上这包含在快速入门手册中。它说:
mvn compile flyway:migrate
但是如果你错过了这个细节并开始调用 mvn flyway:migrate
,SQL 文件将不会被复制到目标目录中(实际上目标目录甚至不存在)你会得到这个神秘的错误。
关于java - 飞路异常 : Unable to scan for SQL migrations in location: classpath:db/migration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23501244/
我正在使用扫描仪检测设备。目前,我的条形码的值为 2345345 A1。因此,当我扫描到记事本或文本编辑器时,输出将类似于 2345345 A1,这是正确的条形码值。 问题是: 当我第一次将条形码扫描
我正在尝试在 Jenkins 的构建后部分运行 Checkmarx Scan。 在我的 Jenkins 工作步骤是--> 1st) 从 SVN Connection 获取源代码到 Checkmarx
我有以下表架构 - CREATE TABLE [dbo].[TEST_TABLE] ( [TEST_TABLE_ID] [int] IDENTITY(1,1) NOT NULL, [N
我有一个关于 postgres 表上的选择的有趣案例: advert (~2.5 million records) id serial, user_id integer (foreig
据我所知,context:component-scan 需要指定 base-package 属性。我如何配置它以扫描类路径中的所有类? 最佳答案 你不知道。那将是一场噩梦。 例如,这意味着加载所有库的
我正在测试不同的查询,我很好奇数据库如何决定使用位图堆扫描和索引扫描。 create index customers_email_idx on customers(email varchar_patt
我在使用中 Swing 不定 import java.util.Scanner; . . . Scanner scan = new Scanner(System.in); . . . Integer.
我有下表 create table log ( id bigint default nextval('log_id_seq'::regclass) not null const
所以我有一个文件要读入,我知道数据将如何列出。例如,我知道每个新行的第一个标记将是 double 。 我一直在使用 Scanner 并且只是使用 scan.nextDouble() 来读取 doubl
在这种情况下,该表有很多文本列,我需要对每一列执行(相似)搜索。我继续为这些列中的每一列创建一个 gin 索引(扩展 pg_trgm 中的 gin_trgm_ops)以加快搜索速度,实际上 yie
我有两个针对 Go 中特定表的查询 - 一个用于检索单个项目,另一个用于返回列表。第一个使用 sql.DB.QueryRow 因为它只需要检索一行,第二个使用 sql.DB.Query 返回几个不同的
添加 StructureMap-MVC3 时打包到 ASP.NET MVC 应用程序, 一个 IoC包含 Initialize 的类添加了包含以下内容的方法(由 App_Start 文件夹中的某些代码
我有以下索引: CREATE INDEX index_c_profiles_on_city_state_name_domain ON c_profiles ((data->>'state'), (da
我在 Postgres 10 中有一个包含 1700 万行和 102 列的表 union_events。我运行命令: CREATE INDEX union_events_index ON temp_s
我以为我知道 Ruby 中的 scan:就好像它在做一个单一的匹配,但对所有结果重复它并放入数组? ruby-1.9.2-p0 > "hello world".scan(/\w{2}/) => ["
我收到此错误并尝试了互联网和 stackoverlow 中可用的所有方法来解决此问题。我试图在使用 sqlx 包连接 MySQL 数据库并扫描结果后运行查询。我已经尝试过针对类似问题共享的解决方案,但
我是 spring 和 Maven 的新手。最近我构建了 spring MVC 项目并使用 maven 来管理项目结构和依赖项。 当我编写单元测试时,我遇到了一个问题,即我无法从“src/main/j
我现在正在尝试 restful api,其中列 SequenceID 不是自动增量,因为故意的,当我像这样计数时,我的问题是库 gorm countSequenceId := db.Debug().T
Scans 当客户端针对表发出扫描时,HBase会为每个区域生成一个RegionScanner对象来提供扫描请求。 该RegionScanner对象包含一个StoreScanner对象列表
我正在构建一个基于浏览器的文档扫描应用程序。我看过多家供应商提供的产品,如 dynamosoft、asprise、atalasoft 等。我对基于浏览器的文档扫描的基本问题是,这些产品中的任何一个都可
我是一名优秀的程序员,十分优秀!