Flyway 和 Maven 集成 - 无法访问 s3://flyway-repo/release
Flyway and Maven integration - Cannot access s3://flyway-repo/release
我想将 flyway 与 maven 和 oracle db 集成。起初我想做一个简单的测试是否有可能进行简单的迁移,所以我做了一个pom文件的构建部分如下(如flyway official page中所述):
<build>
<plugins>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>4.2.0</version>
<configuration>
<url>jdbc:oracle:thin:@localhost:1521:XE</url>
<user>test</user>
<password>test</password>
<schemas>
<schema>TEST</schema>
</schemas>
</configuration>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
但是当我尝试 运行 flyway:migrate 或 flyway:info 目标时,我收到以下错误,我不知道这与什么有关..
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:4.2.0:info (default-cli) on project gwm-admin: Execution default-cli of goal org.flywaydb:flyway-maven-plugin:4.2.0:info failed: Plugin org.fl
ywaydb:flyway-maven-plugin:4.2.0 or one of its dependencies could not be resolved: Could not transfer artifact com.oracle:ojdbc14:jar:10.2.0.4.0 from/to flyway-repo-private (s3://flyway-repo/release): Canno
t access s3://flyway-repo/release with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access s3://flyway-repo/release using the registered transporter factorie
s: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: s3
[ERROR] -> [Help 1]
使用此代码:
<properties>
<maven.compiler.source> java version </maven.compiler.source>
<maven.compiler.target> java version </maven.compiler.target>
</properties>
<dependencies>
<!-- Fly way -->
<dependency>
<groupId>com.googlecode.flyway</groupId>
<artifactId>flyway-core</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
(...)
</plugin>
</plugins>
</build>
如@Arkadiusz Łukasiewicz 在评论中所写,需要手动添加 oracle jdbc 驱动程序。有关更多信息,请参见此处:mkyong post
另一方面,在添加驱动程序后,我得到了另一个错误,可以通过将依赖项从插件部分移到 pom.xml 文件
的主要依赖项中来解决
我想将 flyway 与 maven 和 oracle db 集成。起初我想做一个简单的测试是否有可能进行简单的迁移,所以我做了一个pom文件的构建部分如下(如flyway official page中所述):
<build>
<plugins>
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>4.2.0</version>
<configuration>
<url>jdbc:oracle:thin:@localhost:1521:XE</url>
<user>test</user>
<password>test</password>
<schemas>
<schema>TEST</schema>
</schemas>
</configuration>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
但是当我尝试 运行 flyway:migrate 或 flyway:info 目标时,我收到以下错误,我不知道这与什么有关..
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:4.2.0:info (default-cli) on project gwm-admin: Execution default-cli of goal org.flywaydb:flyway-maven-plugin:4.2.0:info failed: Plugin org.fl
ywaydb:flyway-maven-plugin:4.2.0 or one of its dependencies could not be resolved: Could not transfer artifact com.oracle:ojdbc14:jar:10.2.0.4.0 from/to flyway-repo-private (s3://flyway-repo/release): Canno
t access s3://flyway-repo/release with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access s3://flyway-repo/release using the registered transporter factorie
s: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: s3
[ERROR] -> [Help 1]
使用此代码:
<properties>
<maven.compiler.source> java version </maven.compiler.source>
<maven.compiler.target> java version </maven.compiler.target>
</properties>
<dependencies>
<!-- Fly way -->
<dependency>
<groupId>com.googlecode.flyway</groupId>
<artifactId>flyway-core</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
(...)
</plugin>
</plugins>
</build>
如@Arkadiusz Łukasiewicz 在评论中所写,需要手动添加 oracle jdbc 驱动程序。有关更多信息,请参见此处:mkyong post
另一方面,在添加驱动程序后,我得到了另一个错误,可以通过将依赖项从插件部分移到 pom.xml 文件
的主要依赖项中来解决