0

I am using org.hibernate.gradle.tools version 1.2.5 (latest) like so:

plugins {
    id "org.hibernate.gradle.tools" version "1.2.5"
}

and

apply plugin: "org.hibernate.gradle.tools"

I have the user and password defined in the database section like so:

import org.hibernate.gradle.tools.Schema

database{
    user = "foo"
    password = "bar"
    basePackage = "baz"
    url = "jdbc:mysql://localhost"
    dialect = "org.hibernate.dialect.MySQL5Dialect"
    catalog = ["dbname" : new Schema("dbname",".*")]
}

But when I run ./gradlew clean hbm2java I keep getting a pop up dialog asking for the user and password. I went through the plugin code and it should come from project.database.user and project.database.password respectively:

https://github.com/institut-de-genomique/hibernatetools-gradle-plugin

I have played around with other settings and they are in fact coming from the database section.

Any ideas?

Here are my dependencies just in case:

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile 'org.springframework.boot:spring-boot-starter-data-jpa'
    compile 'org.hibernate:hibernate-core'
    runtime 'mysql:mysql-connector-java'
    runtime 'org.springframework.boot:spring-boot-devtools'
}
aimass
  • 408
  • 5
  • 11

1 Answers1

0

It turned out to be a bug. I submitted a patch to the plugin and should be fixed by 1.2.6: https://github.com/institut-de-genomique/hibernatetools-gradle-plugin/pull/14

In the mean time you can use a local copy with either the source from above, or from my fork which is just 1.2.5 with these two simple fixes: https://github.com/aimass/hibernatetools-gradle-plugin/blob/master/build.gradle

Please note that mine will install in your local maven repo as 1.2.5-CUSTOM and don't forget to add a custom classpath in your buildscript section such as

 classpath group: 'org.hibernate.gradle.tools',
            name: 'hibernatetools-gradle-plugin',
            version: '1.2.5-CUSTOM'

Also don't forget to add mavenLocal() to your repositories sections, AFTER mavenCentral() to be sure.

Alternatively, you can just wait for 1.2.6 which should be released soon.

aimass
  • 408
  • 5
  • 11