Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquibase with Gradle fails to execute in v8.0.0-beta.1 #22665

Closed
1 task done
hide212131 opened this issue Jun 25, 2023 · 0 comments · Fixed by #22667
Closed
1 task done

Liquibase with Gradle fails to execute in v8.0.0-beta.1 #22665

hide212131 opened this issue Jun 25, 2023 · 0 comments · Fixed by #22667

Comments

@hide212131
Copy link
Contributor

hide212131 commented Jun 25, 2023

Overview of the issue

The following commands fail to execute:

./gradlew liquibaseDiffChangelog -PrunList=diffLog
./gradlew liquibaseUpdate
$ ./gradlew liquibaseStatus

> Task :liquibaseStatus FAILED
liquibase-plugin: The 'changeLogFile' has been deprecated.  Please use 'changelogFile' in your activity instead.
liquibase-plugin: Running the 'main' activity...
Error: Unable to initialize main class liquibase.integration.commandline.LiquibaseCommandLine
Caused by: java.lang.NoClassDefFoundError: picocli/CommandLine$IFactory

FAILURE: Build failed with an exception.
Motivation for or Use Case

The commands from the Database updates with the liquibase plugin section in the JHipster documentation do not work as expected.

Reproduce the error

Create a Gradle project and execute ./gradlew liquibaseStatus

Related issues

While the resolution differs, a related issue exists where Maven also fails to execute Liquibase, as mentioned in #19518.

Suggest a Fix

As suggested in this section of the Liquibase Gradle plugin documentation, it appears necessary to add liquibaseRuntime 'info.picocli:picocli:4.6.1. Additionally, it seems we need to avoid passing empty string arguments to Liquibase.

I will submit a PR to address this issue shortly.

JHipster Version(s)

v8.0.0-beta.1

JHipster configuration
.yo-rc.json file
{
  "applicationType": "monolith",
  "authenticationType": "jwt",
  "baseName": "myAppGradle",
  "buildTool": "gradle",
  "cacheProvider": "ehcache",
  "clientFramework": "react",
  "clientTheme": "none",
  "creationTimestamp": 1687535329008,
  "databaseType": "sql",
  "devDatabaseType": "h2Disk",
  "devServerPort": 9060,
  "dtoSuffix": "DTO",
  "enableGradleEnterprise": null,
  "enableHibernateCache": true,
  "enableSwaggerCodegen": false,
  "enableTranslation": true,
  "entities": [
    "Employee",
    "Location",
    "Task",
    "Department",
    "Job",
    "Region",
    "JobHistory",
    "Country"
  ],
  "entitySuffix": "",
  "gradleEnterpriseHost": null,
  "jhiPrefix": "jhi",
  "jhipsterVersion": "8.0.0-beta.1",
  "languages": [
    "ja",
    "en",
    "fr"
  ],
  "lastLiquibaseTimestamp": 1687598012000,
  "messageBroker": false,
  "microfrontend": false,
  "microfrontends": [],
  "nativeLanguage": "ja",
  "packageFolder": "com/mycompany/myapp",
  "packageName": "com.mycompany.myapp",
  "pages": [],
  "prodDatabaseType": "postgresql",
  "reactive": false,
  "searchEngine": false,
  "serverPort": null,
  "serverSideOptions": [],
  "serviceDiscoveryType": false,
  "skipCheckLengthOfIdentifier": false,
  "skipClient": false,
  "skipFakeData": false,
  "skipUserManagement": false,
  "testFrameworks": [],
  "websocket": false,
  "withAdminUi": true
}
Environment and Tools

openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 19.0.1+10-jvmci-22.3-b08)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 19.0.1+10-jvmci-22.3-b08, mixed mode, sharing)

git version 2.39.2 (Apple Git-143)

node: v20.2.0
npm: 9.6.6

Docker version 23.0.6, build ef23cbc

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
/**
 * The Employee entity.
 */
entity Employee {
  /**
   * The firstname attribute.
   */
  firstName String
  lastName String
  email String
  phoneNumber String
  hireDate Instant
  salary Long
  commissionPct Long
}
/**
 * not an ignored comment
 */
entity Location {
  streetAddress String
  postalCode String
  city String
  stateProvince String
}
/**
 * Task entity.\n@author The JHipster team.
 */
entity Task {
  title String
  description String
}
entity Department {
  departmentName String required
}
entity Job {
  jobTitle String
  minSalary Long
  maxSalary Long
}
entity Region {
  regionName String
}
entity JobHistory {
  startDate Instant
  endDate Instant
  language Language
}
entity Country {
  countryName String
}
enum Language {
  FRENCH,
  ENGLISH,
  SPANISH
}

relationship OneToOne {
  Location{country} to Country
  Department{location} to Location
  JobHistory{job} to Job
  JobHistory{department} to Department
  JobHistory{employee} to Employee
  Country{region} to Region
}
relationship OneToMany {
  Employee{job} to Job
  /**
   * A relationship
   */
  Department{employee} to Employee
}
relationship ManyToOne {
  Employee{manager} to Employee
}
relationship ManyToMany {
  Job{task(title)} to Task{job}
}

paginate Employee, JobHistory with infinite-scroll
paginate Job with pagination
search Employee, Location, Task, Department, Job, Region, JobHistory, Country with no
service Location, Task, Department, Region, JobHistory, Country with serviceImpl

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants