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-maven-plugin fails whith liquibase:diff in fresh generated jhipster 7.9.2 project #19518

Closed
joe-bookwood opened this issue Aug 23, 2022 · 16 comments · Fixed by #22737
Closed

Comments

@joe-bookwood
Copy link

When I run in a fresh installed jhipster 7.9.2 project:

./mvnw liquibase:diff compile                            
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< de.bitc.jhipster:jhipster-test >-------------------
[INFO] Building Jhipster Test 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- liquibase-maven-plugin:4.12.0:diff (default-cli) @ jhipster-test ---
[WARNING] The POM for org.liquibase:liquibase-test-harness:jar:1.0.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.461 s
[INFO] Finished at: 2022-08-23T19:26:38+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] version can neither be null, empty nor blank
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

it fails.

Motivation for or Use Case

I used the liquibase diff feature often in older versions without problems. It generate automatic the liquibase xml files.

Reproduce the error

Generate an new project or check out my test project and run ./mvnw liquibase:diff compile

Related issues
Suggest a Fix
JHipster Version(s)
[email protected] /home/buchholz/project/private/jhipster/jhipster-test
└── [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationIndex": 0,
    "applicationType": "monolith",
    "authenticationType": "oauth2",
    "baseName": "jhipsterTest",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angularX",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "creationTimestamp": 1659782029370,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "devServerPort": 4200,
    "dtoSuffix": "DTO",
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": ["Region", "Country", "Location", "Department", "Task", "Employee", "Job", "JobHistory"],
    "entitySuffix": "",
    "gradleEnterpriseHost": "",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "7.9.2",
    "languages": ["en"],
    "lastLiquibaseTimestamp": 1659782509000,
    "messageBroker": false,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageFolder": "de/bitc/jhipster",
    "packageName": "de.bitc.jhipster",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8080",
    "serviceDiscoveryType": false,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "skipUserManagement": true,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Region {
  regionName String
}
entity Country {
  countryName String
}
/**
 * not an ignored comment
 */
entity Location {
  streetAddress String
  postalCode String
  city String
  stateProvince String
}
entity Department {
  departmentName String required
}
/**
 * Task entity.\n@author The JHipster team.
 */
entity Task {
  title String
  description String
}
/**
 * The Employee entity.
 */
entity Employee {
  /**
   * The firstname attribute.
   */
  firstName String
  lastName String
  email String
  phoneNumber String
  hireDate Instant
  salary Long
  commissionPct Long
}
entity Job {
  jobTitle String
  minSalary Long
  maxSalary Long
}
entity JobHistory {
  startDate Instant
  endDate Instant
  language Language
}
enum Language {
  FRENCH,
  ENGLISH,
  SPANISH
}

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

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

Environment and Tools

openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment 11.0.15_p10-r1 (build 11.0.15+10)
OpenJDK 64-Bit Server VM 11.0.15_p10-r1 (build 11.0.15+10, mixed mode, sharing)

git version 2.35.1

node: v18.6.0

npm: 8.13.2

Docker version 20.10.12, build e91ed5707e

docker-compose version 1.29.2, build unknown

No change to package.json was detected. No package manager install will be executed.
Congratulations, JHipster execution is complete!

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • [ x] Checking this box is mandatory (this is just to show you read everything)
@gmarziou
Copy link
Contributor

I made some tests like upgrading liquibase to 4.15.0, forcing version on dependency to liquibase-test-harness 1.0.6, nothing helped.

I then ran maven with -X option and got the error that seems to indicate that the problem is in Liquibase.

[INFO] --- liquibase-maven-plugin:4.12.0:diff (default-cli) @ jhipster-test ---
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for releases.java.net (http://maven.java.net/content/repositories/releases/).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for shapshots.java.net (http://maven.java.net/content/repositories/snapshots/).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for jvnet-nexus-staging (http://maven.java.net/content/repositories/staging/).
[DEBUG] Using mirror maven-default-http-blocker (http://0.0.0.0/) for netbeans (http://bits.netbeans.org/nexus/content/groups/netbeans).
[WARNING] The POM for org.liquibase:liquibase-test-harness:jar:1.0.5 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for org.liquibase:liquibase-test-harness:1.0.5
[ERROR] 'dependencies.dependency.systemPath' for com.ibm.db2:db2-z-licence:jar must specify an absolute path but is ${project.basedir}/src/main/resources/drivers/db2/db2jcc_license_cisuz.jar @

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.262 s
[INFO] Finished at: 2022-08-27T23:31:53+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] version can neither be null, empty nor blank
java.lang.IllegalArgumentException: version can neither be null, empty nor blank
    at org.apache.commons.lang3.Validate.notBlank (Validate.java:454)
    at org.apache.maven.artifact.ArtifactUtils.notBlank (ArtifactUtils.java:107)
    at org.apache.maven.artifact.ArtifactUtils.key (ArtifactUtils.java:97)
    at org.apache.maven.ReactorReader.findArtifact (ReactorReader.java:101)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:306)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:207)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:240)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:171)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.resolveCachedArtifactDescriptor (DefaultDependencyCollector.java:538)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.getArtifactDescriptorResult (DefaultDependencyCollector.java:523)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:410)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.processDependency (DefaultDependencyCollector.java:362)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.process (DefaultDependencyCollector.java:349)
    at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:254)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:284)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolveInternal (DefaultPluginDependenciesResolver.java:218)
    at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:165)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm (DefaultMavenPluginManager.java:404)
    at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm (DefaultMavenPluginManager.java:374)
    at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm (DefaultBuildPluginManager.java:234)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:105)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:53)
    at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:152)
    at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:76)

@mraible
Copy link
Contributor

mraible commented Aug 27, 2022 via email

@mshima
Copy link
Member

mshima commented Aug 27, 2022

Profile (dev or prod) may be required. Cannot test in the moment.

@gmarziou
Copy link
Contributor

gmarziou commented Aug 28, 2022

So I tried to run with dev profile: no change, expected as dev is the default profile.

For prod profile, I had to start postgresql using:

docker compose -f src\main\docker\postgresql.yml up -d

And then

mvnw.cmd liquibase:diff -Pprod
Maven claims success with a very long output from which I removed all the artifacts it puts in its classpath
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< de.bitc.jhipster:jhipster-test >-------------------
[INFO] Building Jhipster Test 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- liquibase-maven-plugin:4.12.0:diff (default-cli) @ jhipster-test ---
[WARNING] The POM for org.liquibase:liquibase-test-harness:jar:1.0.5 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[ERROR] The liquibase-maven-plugin now manages logging via the standard maven logging config, not the 'logging' configuration. Use the -e, -X or -q flags or see https://maven.apache.org/maven-logging.html
[INFO] ------------------------------------------------------------------------
[INFO] Loading artifacts into URLClassLoader
[INFO] ------------------------------------------------------------------------
[INFO] ####################################################
##   _     _             _ _                      ##
##  | |   (_)           (_) |                     ##
##  | |    _  __ _ _   _ _| |__   __ _ ___  ___   ##
##  | |   | |/ _` | | | | | '_ \ / _` / __|/ _ \  ##
##  | |___| | (_| | |_| | | |_) | (_| \__ \  __/  ##
##  \_____/_|\__, |\__,_|_|_.__/ \__,_|___/\___|  ##
##              | |                               ##
##              |_|                               ##
##                                                ## 
##  Get documentation at docs.liquibase.com       ##
##  Get certified courses at learn.liquibase.com  ## 
##  Free schema change activity reports at        ##
##      https://hub.liquibase.com                 ##
##                                                ##
####################################################
Starting Liquibase at 09:22:31 (version 4.12.0 #3073 built at 2022-06-17 05:59+0000)
[INFO] Settings
----------------------------
[INFO]     driver: org.postgresql.Driver
[INFO]     url: jdbc:postgresql://localhost:5432/jhipsterTest
[INFO]     username: *****
[INFO]     password: *****
[INFO]     use empty password: false
[INFO]     properties file: null
[INFO]     properties file will override? false
[INFO]     clear checksums? false
[INFO]     changeLogDirectory: null
[INFO]     changeLogFile: D:\projets\jhipster-projects\issues\jhipster-test/src/main/resources/config/liquibase/master.xml
[INFO]     context(s): !test
[INFO]     label(s): null
[INFO]     referenceDriver: null
[INFO]     referenceUrl: hibernate:spring:de.bitc.jhipster.domain?dialect=tech.jhipster.domain.util.FixedPostgreSQL10Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
[INFO]     referenceUsername: *****
[INFO]     referencePassword: *****
[INFO]     referenceDefaultSchema: null
[INFO]     diffChangeLogFile: D:\projets\jhipster-projects\issues\jhipster-test/src/main/resources/config/liquibase/changelog/20220828072229_changelog.xml
[INFO] ------------------------------------------------------------------------
[INFO] Set default schema name to public
[INFO] Executing on Database: jdbc:postgresql://localhost:5432/jhipsterTest
[INFO] Loading artifacts into URLClassLoader

[INFO] ------------------------------------------------------------------------
[INFO] Reading hibernate configuration hibernate:spring:de.bitc.jhipster.domain?dialect=tech.jhipster.domain.util.FixedPostgreSQL10Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
[INFO] Found package de.bitc.jhipster.domain
[INFO] HHH000204: Processing PersistenceUnitInfo [name: default]
[INFO] HHH000412: Hibernate ORM core version 5.6.9.Final
[INFO] HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
[WARNING] HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections
[WARNING] HHH000342: Could not obtain connection to query metadata
java.lang.UnsupportedOperationException: The application must supply JDBC connections
at org.hibernate.engine.jdbc.connections.internal.UserSuppliedConnectionProviderImpl.getConnection (UserSuppliedConnectionProviderImpl.java:44)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection (JdbcEnvironmentInitiator.java:181)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService (JdbcEnvironmentInitiator.java:68)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService (JdbcEnvironmentInitiator.java:35)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService (StandardServiceRegistryImpl.java:101)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService (AbstractServiceRegistryImpl.java:263)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService (AbstractServiceRegistryImpl.java:237)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService (AbstractServiceRegistryImpl.java:214)
at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices (DefaultIdentifierGeneratorFactory.java:175)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies (AbstractServiceRegistryImpl.java:286)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService (AbstractServiceRegistryImpl.java:243)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService (AbstractServiceRegistryImpl.java:214)
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl. (InFlightMetadataCollectorImpl.java:173)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete (MetadataBuildingProcess.java:127)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata (EntityManagerFactoryBuilderImpl.java:1460)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build (EntityManagerFactoryBuilderImpl.java:1494)
at liquibase.ext.hibernate.database.HibernateEjb3Database.buildMetadataFromPath (HibernateEjb3Database.java:59)
at liquibase.ext.hibernate.database.HibernateDatabase.buildMetadata (HibernateDatabase.java:143)
at liquibase.ext.hibernate.database.HibernateDatabase.setConnection (HibernateDatabase.java:83)
at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation (DatabaseFactory.java:121)
at liquibase.database.DatabaseFactory.openDatabase (DatabaseFactory.java:141)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject (CommandLineUtils.java:92)
at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.performLiquibaseTask (LiquibaseDatabaseDiff.java:234)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.lambda$null$0 (AbstractLiquibaseMojo.java:528)
at liquibase.Scope.lambda$child$0 (Scope.java:180)
at liquibase.Scope.child (Scope.java:189)
at liquibase.Scope.child (Scope.java:179)
at liquibase.Scope.child (Scope.java:158)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.lambda$null$1 (AbstractLiquibaseMojo.java:527)
at liquibase.Scope.lambda$child$0 (Scope.java:180)
at liquibase.Scope.child (Scope.java:189)
at liquibase.Scope.child (Scope.java:179)
at liquibase.Scope.child (Scope.java:158)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.lambda$execute$2 (AbstractLiquibaseMojo.java:451)
at liquibase.Scope.lambda$child$0 (Scope.java:180)
at liquibase.Scope.child (Scope.java:189)
at liquibase.Scope.child (Scope.java:179)
at liquibase.Scope.child (Scope.java:158)
at liquibase.Scope.child (Scope.java:243)
at liquibase.Scope.child (Scope.java:247)
at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute (AbstractLiquibaseMojo.java:384)
at org.liquibase.maven.plugins.LiquibaseDatabaseDiff.execute (LiquibaseDatabaseDiff.java:204)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:53)
at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:152)
at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:76)
[INFO] HHH000400: Using dialect: tech.jhipster.domain.util.FixedPostgreSQL10Dialect
[INFO] Envers integration enabled? : true
[INFO] HV000001: Hibernate Validator 6.2.3.Final
[INFO] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
[INFO] HHH000400: Using dialect: tech.jhipster.domain.util.FixedPostgreSQL10Dialect
[INFO] Using dialect tech.jhipster.domain.util.FixedPostgreSQL10Dialect
[INFO] Performing Diff on database jhipsterTest @ jdbc:postgresql://localhost:5432/jhipsterTest (Default Schema: public)
BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Some database objects and their dependencies cannot be represented automatically, and they may need to be manually updated before being deployed.
[INFO] changeSets count: 0
[INFO] No changesets to add.
[INFO] Differences written to Change Log File, D:\projets\jhipster-projects\issues\jhipster-test/src/main/resources/config/liquibase/changelog/20220828072229_changelog.xml
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.911 s
[INFO] Finished at: 2022-08-28T09:22:33+02:00
[INFO] ------------------------------------------------------------------------

@joe-bookwood
Copy link
Author

I used no profile (default, is dev) and the H2 database.

@timothystone
Copy link
Contributor

Seeing the same problem. Fresh install using a monolith with Jhipster 7.9.2.

@francoiscorporate
Copy link

francoiscorporate commented Nov 25, 2022

Hello,
Using jhipster 7.9.3, I have the same problem.
I added a field to an entity, and because the sub generator did not create new database changelog (liquibase) automatically and overwritted the original entity changelog file, I had to try running "./mvnw -X liquibase:diff" and then I had this error. I am a bit sad..

@francoiscorporate
Copy link

francoiscorporate commented Nov 25, 2022

OK.. I upgraded Liquibase version to 4.17.2 and the first error message disapeared :

<spring-boot.version>2.7.3</spring-boot.version>
 <!-- The liquibase version should match the one managed by
        https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
        <!--<liquibase.version>4.15.0</liquibase.version>-->
        <!--<liquibase-hibernate5.version>4.15.0</liquibase-hibernate5.version>-->
        <liquibase.version>4.17.2</liquibase.version>
        <liquibase-hibernate5.version>4.17.2</liquibase-hibernate5.version>

(I went here to get a better version available for spring boot 2.7.3 : https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/2.7.3)

Now I still have the second message :

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  14.791 s
[INFO] Finished at: 2022-11-25T11:03:23+01:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "maven-plugin-repository" could not be activated because it does not exist.
[ERROR] version can neither be null, empty nor blank
java.lang.IllegalArgumentException: version can neither be null, empty nor blank

I someone can help with this one..

Thanks

@francoiscorporate
Copy link

francoiscorporate commented Nov 25, 2022

Hurray !
Solved part of the problem :

As the error message specifies that the "version can neither be null, empty nor blank", I added the version in the pom and it works 👍

<dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>2.1.214</version>
</dependency>

Now I have an other problem : The H2 database must be running. And If running by "./mvnw" in a terminal, appears another problem :

[ERROR] liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:h2:file:C:\blabla\IdeaProjects\esbportal\target/h2d
b/db/esbportal with driver org.h2.Driver. Make sure your H2 database is active and accessible by opening a new terminal window, run "liquibase init start-h2", and then return to this terminal window to run commands.

So I'm near the solution..

@willmear
Copy link

Did you manage to find the solution?

@francoiscorporate
Copy link

francoiscorporate commented Apr 25, 2023 via email

@erycoking
Copy link

erycoking commented May 1, 2023

Hi guys,
am using version 7.9.3 and I was experiencing the same issue

I solved the issue by adding the version of h2 under the plugin dependencies as follows

<plugin>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-maven-plugin</artifactId>
      <version>${liquibase.version}</version>
      <configuration>
          ...
      </configuration>
      <dependencies>
          <dependency>
              <groupId>org.liquibase</groupId>
              <artifactId>liquibase-core</artifactId>
              <version>${liquibase.version}</version>
          </dependency>
          <dependency>
              <groupId>org.liquibase.ext</groupId>
              <artifactId>liquibase-hibernate5</artifactId>
              <version>${liquibase-hibernate5.version}</version>
          </dependency>
          <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-data-jpa</artifactId>
              <version>${spring-boot.version}</version>
          </dependency>
          <dependency>
              <groupId>javax.validation</groupId>
              <artifactId>validation-api</artifactId>
              <version>${validation-api.version}</version>
          </dependency>
          <dependency>
              <groupId>com.h2database</groupId>
              <artifactId>h2</artifactId>
              <version>2.1.214</version>   <----------------------
          </dependency>
      </dependencies>
  </plugin>

enjoy :)

@hide212131
Copy link
Contributor

Additionally, removing '.Final' from the version is required for proper operation.

<validation-api.version>3.0.2.Final</validation-api.version>

@mshima
Copy link
Member

mshima commented Jun 29, 2023

@hide212131 can you create a PR fixing the version?

@hide212131
Copy link
Contributor

@mshima Yes, I plan to create a PR, after addressing the Gradle issue first 😅.

@flyliu33
Copy link

flyliu33 commented Oct 9, 2023

Hi guys, am using version 7.9.3 and I was experiencing the same issue

I solved the issue by adding the version of h2 under the plugin dependencies as follows

<plugin>
      <groupId>org.liquibase</groupId>
      <artifactId>liquibase-maven-plugin</artifactId>
      <version>${liquibase.version}</version>
      <configuration>
          ...
      </configuration>
      <dependencies>
          <dependency>
              <groupId>org.liquibase</groupId>
              <artifactId>liquibase-core</artifactId>
              <version>${liquibase.version}</version>
          </dependency>
          <dependency>
              <groupId>org.liquibase.ext</groupId>
              <artifactId>liquibase-hibernate5</artifactId>
              <version>${liquibase-hibernate5.version}</version>
          </dependency>
          <dependency>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-data-jpa</artifactId>
              <version>${spring-boot.version}</version>
          </dependency>
          <dependency>
              <groupId>javax.validation</groupId>
              <artifactId>validation-api</artifactId>
              <version>${validation-api.version}</version>
          </dependency>
          <dependency>
              <groupId>com.h2database</groupId>
              <artifactId>h2</artifactId>
              <version>2.1.214</version>   <----------------------
          </dependency>
      </dependencies>
  </plugin>

enjoy :)

Although I had run my project afteradding <version>2.1.214</version> like you, it didn't work for me and H2 didn't work either. Jhipster 7.9.4
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:4.15.0:diff (default-cli) on project monolithic: [ERROR] Error setting up or running Liquibase: [ERROR] liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Connection could not be created to jdbc:h2:file:C:\workspace\jhipster\monolith ic\target/h2db/db/monolithic with driver org.h2.Driver. Make sure your H2 database is active and accessible by opening a new terminal window, run "liquibase init start-h2", and then return to this termin al window to run commands. Database may be already in use: "C:/workspace/jhipster/monolithic/target/h2db/db/monolithic.mv.db". Possible solutions: close all other connection(s); use the server mode [900 20-214]: The file is locked: C:/workspace/jhipster/monolithic/target/h2db/db/monolithic.mv.db [2.1.214/7]

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.