Morten Andersen-Gott
01/20/2021, 2:56 PMcom.ewerk.gradle.plugins.jaxb2
-plugin. So far I’ve got the classes generated, but they don’t seem to be added to my classpath correctly, as I can’t use them from my kotlin source code. The generated java classes are put in src/generated/java
. anyone got any experience with using java generators in componation with kotlin? Or got a working jaxb/kotlin/gradle/kotlin-dsl example?Alex Nordlund
01/20/2021, 2:59 PMsrc/generated
is the following: (sorry for the groovy)
sourceSets {
main {
java {
srcDirs += ['src/generated/java']
Morten Andersen-Gott
01/20/2021, 3:38 PMAlex Nordlund
01/20/2021, 3:42 PMsourceSets {
main {
java {
srcDirs += ['src/generated/java']
}
}
}
jaxb2 {
xjc {
'hello' {
generatedSourcesDir = 'src/generated/java'
basePackage = 'com.ourcompany'
schema = 'src/main/resources/xsd/schema.xsd'
createSourceSet = false
}
}
}
dependencies {
compile jaxbApi
jaxb2 'org.glassfish.jaxb:jaxb-xjc:2.4.0-b180830.0438'
}
Alex Nordlund
01/20/2021, 3:47 PMMorten Andersen-Gott
01/20/2021, 4:53 PMAlex Nordlund
01/20/2021, 4:54 PMMorten Andersen-Gott
01/21/2021, 7:57 AMAlex Nordlund
01/21/2021, 8:50 AMsrc/generated/java
and to put that into .gitignore