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

How can I use it in build.gradle.kts #39

Closed
bvo opened this issue Feb 7, 2019 · 3 comments
Closed

How can I use it in build.gradle.kts #39

bvo opened this issue Feb 7, 2019 · 3 comments
Labels

Comments

@bvo
Copy link

bvo commented Feb 7, 2019

Hi,

I want to use the plugin in my build.gradle.kts

I succeed to add the plugin

plugins {
    id( "io.github.divinespear.jpa-schema-generate") version "0.3.5.1"
}

The groovy configuration is not compatible

generateSchema {
  vendor = 'hibernate' // 'eclipselink', 'hibernate', or 'hibernate+spring'.
                       // you can use class name too. (like 'org.hibernate.jpa.HibernatePersistenceProvider')
  packageToScan = [ 'your.package.to.scan', ... ]
  ...
}

But I didn't manage to convert it

thanks

@bvo
Copy link
Author

bvo commented Feb 7, 2019

configure<JpaSchemaGenerationExtension> {
    vendor = "hibernate"
    packageToScan = listOf("your.package.to.scan").toSet()
}

@ausov
Copy link

ausov commented Feb 13, 2021

Example with Spring:

generateSchema {
  vendor = "hibernate+spring"
  packageToScan = setOf("com.example")
  scriptAction = "create"
  createSourceMode = "metadata"
  outputDirectory = file("build/generated-schema")

  properties = mapOf(
    "hibernate.physical_naming_strategy" to "org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy",
    "hibernate.implicit_naming_strategy" to "org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy"
  )

  targets {
    create("mysql") {
      databaseProductName = "MySQL"
      databaseMajorVersion = 5
      databaseMinorVersion = 7
    }
    create("hsqldb") {
      databaseProductName = "HSQL Database Engine"
    }
  }
}

@divinespear
Copy link
Owner

@bvo I've updated README
@ausov nice example! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants