Hi Asif, Thank you very much for your message. I'm glad you got it to work. The third party Gradle plugin has a default jOOQ version hard coded in it, which can be overridden.
Do note, you seem to be using both the third party Gradle plugin, *and* a manual configuration of the code generator using the MarkupBuilder. Ideally, you would pick only one approach. Advantages of each are: - The MarkupBuilder approach does not add any additional third party dependency, which may simplify your build a little bit - The third party Gradle plugin is maintained by a Gradle employee with a lot of insight into Gradle's inner workings, which leverages quite a few Gradle features to improve the integration Our current official recommendation is to use the third party Gradle plugin. I hope this helps, Lukas On Tue, Aug 21, 2018 at 3:34 AM <[email protected]> wrote: > Looks like the jooq gradle plugin caused a transitive dependency to jooq > 3.11.2 (see entry at the top of the generated file). This is different > from the locally downloaded trail version 3.11.4. > > > I was able to get it to work by removing the jooq plugin from the > buildScript classpath. The following change got it building correctly: > > > dependencies { > > classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}", > "com.microsoft.sqlserver:mssql-jdbc:6.2.2.jre8" > ) > > classpath fileTree(dir: 'libs/JOOQ/3.11.4/JOOQ-lib', include: '*.jar', > exclude: 'jooq-scala*.jar') > } > > > > > > On Monday, August 20, 2018 at 6:44:08 PM UTC-4, [email protected] > wrote: >> >> >> Hi, >> >> I am working with the 3.11.4 trial version. All files are generated >> correctly except DefaultCatalog.java. The DefaultCatalog.java is generated >> with multiple duplicate entries for the inputSchema. >> >> Removing the duplicate in DefaultCatalog.java manually results in >> successful compilation of all generated java files. But every time I >> re-run the codegen task they re-appear. >> >> Any help or advice is most appreciated. >> >> >> >> *GRADLE CONFIG* >> >> ================================================================================================= >> >> buildscript { >> >> ext { >> springBootVersion = '2.0.4.RELEASE' >> } >> repositories { >> >> flatDir dirs: ["$projectDir/libs/JOOQ/3.11.4/JOOQ-lib"] >> jcenter() >> } >> dependencies { >> >> classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}", >> "nu.studer:gradle-jooq-plugin:3.0.1", >> "com.microsoft.sqlserver:mssql-jdbc:6.2.2.jre8", >> "org.flywaydb:flyway-gradle-plugin:4.1.1" >> ) >> >> classpath fileTree(dir: '$projectDir/libs/JOOQ/3.11.4/JOOQ-lib', include: >> '*.jar', exclude: 'jooq-scala-*.jar') >> } >> } >> >> apply plugin: 'java' >> apply plugin: 'idea' >> apply plugin: 'org.springframework.boot' >> apply plugin: 'io.spring.dependency-management' >> apply plugin: 'org.flywaydb.flyway' >> >> group = 'com.thirdpoint.server' >> version = '0.0.1-SNAPSHOT' >> sourceCompatibility = 1.8 >> >> repositories { >> >> flatDir dirs: ["$projectDir/libs/JOOQ/3.11.4/JOOQ-lib"] >> jcenter() >> } >> >> ext { >> springCloudVersion = 'Finchley.SR1' >> } >> >> ext['jooq.version'] = '3.11.4' >> >> dependencies { >> >> compile name: 'jooq-3.11.4' >> compile('org.springframework.boot:spring-boot-starter-actuator') >> compile('org.springframework.boot:spring-boot-starter-websocket') >> compile('org.springframework.cloud:spring-cloud-starter-aws') >> compile('org.springframework.cloud:spring-cloud-stream') >> compile('org.springframework.cloud:spring-cloud-stream-binder-kafka') >> compile('org.springframework.kafka:spring-kafka') >> compile('org.flywaydb:flyway-core:3.2.1') >> >> testCompile('org.springframework.boot:spring-boot-starter-test') >> testCompile('org.springframework.cloud:spring-cloud-stream-test-support') >> } >> >> dependencyManagement { >> imports { >> mavenBom >> "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" >> } >> } >> >> task generateAccounting { >> doLast { >> >> def writer = new StringWriter() >> def xml = new groovy.xml.MarkupBuilder(writer) >> .configuration('xmlns': 'http://www.jooq.org/xsd/jooq-codegen-3.11.0.xsd') >> { >> jdbc() { >> driver('com.microsoft.sqlserver.jdbc.SQLServerDriver') >> url('jdbc:sqlserver://XXXX;integratedSecurity=true;databaseName=XXXX') >> } >> generator() { >> database { >> inputSchema 'stage' >> } >> >> generate([:]) { >> pojos true >> daos true >> } >> target() { >> packageName('com.thirdpoint.server.model.generated.accounting') >> directory('src/main/java/') >> } >> } >> } >> >> org.jooq.codegen.GenerationTool.generate( >> javax.xml.bind.JAXB.unmarshal(new StringReader(writer.toString()), >> org.jooq.meta.jaxb.Configuration.class) >> ) >> } >> } >> >> >> task generateAll { >> dependsOn generateAccounting >> } >> >> >> >> >> *GENERATED DefaultCatalog.java* >> >> ======================================================================================================================================= >> >> /* >> * This file is generated by jOOQ. >> */ >> package com.thirdpoint.server.model.generated.accounting; >> >> >> import com.thirdpoint.server.model.generated.accounting.stage.Stage; >> >> import java.util.ArrayList; >> import java.util.Arrays; >> import java.util.List; >> >> import javax.annotation.Generated; >> >> import org.jooq.Schema; >> import org.jooq.impl.CatalogImpl; >> >> >> /** >> * This class is generated by jOOQ. >> */ >> @Generated( >> value = { >> "http://www.jooq.org", >> "jOOQ version:3.11.2" >> }, >> comments = "This class is generated by jOOQ" >> ) >> @SuppressWarnings({ "all", "unchecked", "rawtypes" }) >> public class DefaultCatalog extends CatalogImpl { >> >> private static final long serialVersionUID = 21313; // replaced when >> posting on JOOQ >> >> /** >> * The reference instance of <code></code> >> */ >> public static final DefaultCatalog DEFAULT_CATALOG = new >> DefaultCatalog(); >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * The schema <code>stage</code>. >> */ >> public final Stage STAGE = >> com.thirdpoint.server.model.generated.accounting.stage.Stage.STAGE; >> >> /** >> * No further instances allowed >> */ >> private DefaultCatalog() { >> super(""); >> } >> >> @Override >> public final List<Schema> getSchemas() { >> List result = new ArrayList(); >> result.addAll(getSchemas0()); >> return result; >> } >> >> private final List<Schema> getSchemas0() { >> return Arrays.<Schema>asList( >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE, >> Stage.STAGE); >> } >> } >> >> >> >> >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
