我正在尝试使用 Flyway 来运行我的数据库迁移脚本。我正在尝试运行两个 SQL 脚本和一个 Java 脚本。当我运行 ./gradlew FlywayMigrate 或 gradle FlywayMigrate 时,它只接收 SQL 脚本,而不接收 Java 脚本。
我的项目设置如下:
database_migrations
--->src
------>main/java
--------->db/migration
-------------V3__load_data.java
----- ->主/资源
--------->数据库/迁移
-------------V1__base_table.sql
-------------V2__stored_procedures.sql
我尝试了多种解决方案来运行 java 脚本,例如指定flyway.locations=classpath:db/migration但只会产生此输出Unable to resolve location classpath:db/migration。我尝试过将其移至其他包。我尝试将其放入罐子中并从命令行工具运行,但它没有找到它。我尝试过 JDBCMigration 和 SpringJDBCMigration 类。
我是否遗漏了它应该如何运行的东西?
当我在 jenkins 实例中使用 gradlewcompileJava 运行它时,它会抛出无法找到tools.jar,不确定是否与我相关
我正在尝试将 Gradle Cobertura 插件用作 Springboot 应用程序上的代码覆盖工具。该应用程序主要是 Java 后端,但确实包含一些常规代码。
我使用的是 Java 1.8.0_152、Gradle 4.4、gradle cobertura 2.5.4 Plugin和 springboot 版本 2.0.0.RC1。
虽然我遇到了这个问题,当仪器尝试发生时它会抛出一个
:instrument
Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Unable to instrument file .../someClass.class
java.lang.RuntimeException
at org.objectweb.asm.MethodVisitor.visitParameter(Unknown Source)
at org.objectweb.asm.ClassReader.b(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:161)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:129)
at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:243)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentationToSingleClass(CodeInstrumentationTask.java:299)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:308)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.addInstrumentation(CodeInstrumentationTask.java:317)
at net.sourceforge.cobertura.instrument.CodeInstrumentationTask.instrument(CodeInstrumentationTask.java:90)
at net.sourceforge.cobertura.dsl.Cobertura.instrumentCode(Cobertura.java:74) …Run Code Online (Sandbox Code Playgroud)