Liquibase Maven插件可以使用哪个Java版本?

戴夫:

是否有可与Java 9一起使用的Liquibase Maven插件版本?我已经设置了以下Maven编译器插件:-

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.1</version>
      <configuration>
        <source>1.9</source>
        <target>1.9</target>
        <compilerArgument>-proc:none</compilerArgument>
        <fork>true</fork>
        <executable>${javac_path}</executable>
       </configuration>
       <executions>
         <execution>
           <id>default-testCompile</id>
           <phase>test-compile</phase>
           <goals>
             <goal>testCompile</goal>
           </goals>
         </execution>
       </executions>
    </plugin>
  </plugins>
</build>

并拥有这个Maven liquibase插件

<!-- Run the liquibase scripts -->
<plugin>
  <groupId>org.liquibase</groupId>
  <artifactId>liquibase-maven-plugin</artifactId>
  <version>${version.liquibase}</version>
  <dependencies>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>${version.mysql}</version>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <id>build-test-database</id>
      <phase>process-test-classes</phase>
      <configuration>
        <driver>com.mysql.jdbc.Driver</driver>
        <url>${test.mysql.dataSource.url}</url>
        <username>${test.mysql.db.user}</username>
        <password>${test.mysql.db.password}</password>
        <changeLogFile>${project.build.directory}/db.changelog-master.xml</changeLogFile>
        <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
        <skip>${skipLiquibaseRun}</skip>
        <clearCheckSums>true</clearCheckSums>
      </configuration>
      <goals>
        <goal>update</goal>
      </goals>
    </execution>
  </executions>
</plugin>

但是运行插件死于错误

[INFO] --- liquibase-maven-plugin:3.3.0:update (build-local-database) @ database ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/jboss/.jenkins/workspace/springboard/session/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] Parsing Liquibase Properties File
[INFO]   File: /home/jboss/.jenkins/workspace/springboard/database/src/main/resources/liquibase.properties
[INFO] ------------------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Source option 1.5 is no longer supported. Use 1.6 or later.
[ERROR] Target option 1.5 is no longer supported. Use 1.6 or later.

当我将编译器版本更改为“ 1.8”时,不会发生这种情况。

名称:

尝试将您的maven-compiler-plugin配置更改为

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version> <!-- JDK9 compatible version-->
<configuration>
    <source>9</source> <!--not 1.9-->
    <target>9</target>
    <compilerArgument>-proc:none</compilerArgument>
    <fork>true</fork>
    <executable>${javac_path}</executable>
</configuration>

自JDK9发行以来,被解析的Java版本的原因不是1.9,而是9。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章