Please help!! Unable to run gradle build on generated sources

317 views
Skip to first unread message

asif.rahman...@gmail.com

unread,
Aug 20, 2018, 1:12:37 PM8/20/18
to jOOQ User Group
Hi,

We are evaluating JOOQ for production use, but not able to run gradle build on generated sources.  Sources are generated fine using the trial version.

The source files are generated under the under the main sourceset here :  \src\main\java\com\thirdpoint\server\model\generated
I would expect the compile fileTree entry to add the jooq jars into the classpath, since the same entry the buildScript section works in generating the files.


But running "gradle build" command ends with the following error on all generated classes:

 \src\main\java\com\thirdpoint\server\model\generated\accounting\stage\Stage.java:34: : error: package org.jooq does not exist

Any help 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 fileTree(dir: '$projectDir/libs/JOOQ/3.11.4/JOOQ-lib', include: '*.jar', exclude: 'jooq-scala-*.jar')
        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)
jdbc() {
driver('com.microsoft.sqlserver.jdbc.SQLServerDriver')
url('jdbc:sqlserver://XXXX;integratedSecurity=true;databaseName=Accounting')
}
generator() {
database() {

schemata() {
schema() {
inputSchema('XXX')
}
schema() {
inputSchema('XXX')
}
schema() {
inputSchema('XXX')
}
}
}

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
}


asif.rahman...@gmail.com

unread,
Aug 20, 2018, 6:16:09 PM8/20/18
to jOOQ User Group
As the flatDirs entry was there in the repositories section, I was able to resolve the issue by replacing

compile fileTree(dir: '$projectDir/libs/JOOQ/3.11.4/JOOQ-lib', include: '*.jar', exclude: 'jooq-scala-*.jar')

with 

compile name: 'jooq-3.11.4'

which is very strange, the first entry should have worked out of the box.

Lukas Eder

unread,
Aug 21, 2018, 4:45:15 AM8/21/18
to jooq...@googlegroups.com
Hi Asif,

Thank you very much for your message. From your follow up message [1], I take that you were able to resolve this issue? If not, please let me know and I will be very happy to assist you.

Thanks,
Lukas


--
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages