JOOQ Doesn't Generate - java

I was following here. I used postgresql instead of h2. I was able to build the project with some additional fields.
I created a package database under com.example.demo, but it was still empty after project was built.
build.gradle:
buildscript {
ext {
springBootVersion = '2.4.2'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.jooq:jooq-codegen:3.14.4'
classpath 'org.postgresql:postgresql:42.2.18'
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '15'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-jooq'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.flywaydb:flyway-core'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
useJUnitPlatform()
}
import org.jooq.codegen.GenerationTool
import org.jooq.meta.jaxb.*
task generate {
def configuration = new Configuration()
configuration
.withJdbc(new Jdbc()
.withDriver('org.postgresql.Driver')
.withUrl('jdbc:postgresql://localhost:5432/vertx')
.withUser('postgres')
.withPassword('postgres'))
.withGenerator(new Generator()
.withDatabase(new Database().withInputSchema('public'))
.withGenerate(new Generate()
.withPojos(true)
.withDaos(true))
.withTarget(new Target()
.withPackageName('com.example.demo.database')
.withDirectory('src/main/java')))
doLast {
GenerationTool.generate(configuration)
}
}
Is there something I am missing? Why can I not see pojos and daos in database package? My database has only one table with 2 columns.
BUILD SUCCESSFULL when I type ./gradlew generate, but nothing gets generated.

You can try ./gradlew generate --info command, which will give you more information about the build process.
My gradle script is quite similar to yours. By using above command, I find out that the classes are actually generated, but in a different folder /Users/{MyUserName}/.gradle/daemon/7.1.1/src/main/java.
So I have to explicitly set the output directory with def outputDirectory = projectDir.toString() + '/src/main/java'.
This works for me
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'org.jooq:jooq-codegen:3.16.2'
classpath 'mysql:mysql-connector-java:8.0.27'
}
}
plugins {
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
if(JavaVersion.current() != JavaVersion.VERSION_11){
throw new GradleException("This build must be run with java 11")
}
repositories {
mavenCentral()
}
group = 'snorlax'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
//create a fat Jar with all dependencies
jar {
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes "Main-Class": "com.snorlax.userservice.MainApplication"
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
// Spring boot
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// Swagger
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// RDS Connection
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'mysql:mysql-connector-java:8.0.27'
// AWS secretes manager
implementation 'com.amazonaws.secretsmanager:aws-secretsmanager-jdbc:1.0.6'
// JOOQ
implementation 'org.springframework.boot:spring-boot-starter-jooq'
implementation 'org.jooq:jooq-meta:3.16.2'
compileOnly 'org.jooq:jooq-codegen:3.16.2'
}
test {
useJUnitPlatform()
}
/************************
jooq code generation
*************************/
import org.jooq.codegen.GenerationTool;
import org.jooq.meta.jaxb.*;
task generate {
def outputDirectory = projectDir.toString() + '/src/main/java'
def configuration = new Configuration()
.withJdbc(new Jdbc()
.withDriver('com.mysql.cj.jdbc.Driver')
.withUrl('jdbc:mysql://127.0.0.1:3306/snorlaxRds')
.withUser('root')
.withPassword('123456'))
.withGenerator(new Generator()
.withDatabase(new Database().withInputSchema("snorlaxRds"))
.withGenerate(new Generate()
.withPojos(true)
.withDaos(true))
.withTarget(new Target()
.withPackageName('snorlax.userservice.database')
.withDirectory(outputDirectory)));
doLast {
GenerationTool.generate(configuration)
}
}

Your file looks okay. I had a similar issue (while using maven). Try three things (that worked for me):
check case of the schema in "withInputSchema" property. Try to pass uppercase PUBLIC.
try to change 'src/main/java' to './src/main/java'
add "includes" and pass .* in it (to generate for all tables in the schema)

Related

build.gradle cannot resolve symbol 'groovy.json.JsonSlurper'

I can't resolve the groovy.json.JsonSlurper in the build.gradle file with Intellij, does anyone know how to fix it?
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
useJUnitPlatform()
}
task sample() {
doLast {
sample();
}
}
import groovy.json.JsonSlurper
def sample(){
def json = new JsonSlurper().parseText('{"a":"b"}')
println(json);
}
You missing the needed dependency.
Add org.codehaus.groovy:groovy-json:3.0.9 in dependencies section so ti will look like
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'org.codehaus.groovy:groovy-json:3.0.9'
}
And then you can test with CLI as gradle sample or ./gradlew sample and it will return {a=b}

ant:taskdef Could not load definitions from resource org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties

Here is my build.gradle , I had upgraded gradle 5.x to 6.9.2 and while executing gradleW build I am getting below error.
[ant:taskdef] Could not load definitions from resource org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties. It could not be found.
Task :compileJava FAILED
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\9796te\Company\2021\December\27\01\hopper-api\build.gradle' line: 180
What went wrong:
Execution failed for task ':compileJava'.
Problem: failed to create task or type iajc
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
And here is the build.gradle file:
plugins {
id 'org.springframework.boot' version '2.1.4.RELEASE'
id 'com.adarshr.test-logger' version '1.6.0'
id 'com.gorylenko.gradle-git-properties' version '2.0.0'
id 'org.sonarqube' version '2.7'
id "com.github.ManifestClasspath" version "0.1.0-RELEASE"
}
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'eclipse'
apply plugin: 'application'
mainClassName = 'com.bp.hopper.Application'
sourceCompatibility = 11
targetCompatibility = 11
jar {
enabled = true
archiveBaseName = 'hopper-api'
archiveVersion = '0.1'
}
bootJar {
classifier = 'application'
}
sourceSets {
integration
}
configurations {
aspects
compile.extendsFrom aspects
}
springBoot {
buildInfo()
}
testlogger {
theme 'mocha'
}
sonarqube {
properties {
property "sonar.projectKey", "com.bp.WellHopper:hopper-api"
}
}
repositories {
mavenCentral()
mavenLocal() // For those who can't access internal BP repos
//jcenter()
maven { url 'http://dml-prime.bpweb.bp.com:8088/artifactory/bp-upstream-devops-lib-release-local' }
}
// Non-spring boot versions
ext.versions = [
accesstokenvalidator: '2.1.4g',
onbehalfof: '2.1.4f',
clientcredentials: '2.1.4h',
swagger: '2.9.2',
applicationinsights: '2.6.0', // if you change this then change web.config and replace the updated jar in project root
commonsio: '2.6',
mssqljdbc: '7.2.2.jre8',
xlxsstreamer: '1.2.0',
guava: '27.1-jre',
beanutils: '1.9.3',
tika: '1.20',
jacksondatatypejts: '2.4',
azurestorage: '8.2.0',
azurekeyvault: '1.2.4',
azure: '1.34.0',
hibernatesearch: '5.10.5.Final',
reflections: '0.9.11',
awaitility: '4.0.3',
microsoftgraph: '1.2.0',
dozer: '6.5.0',
lombok: '1.18.12',
hibernatetypes: '2.10.0',
qpid: '0.55.0',
javaobjectdiff: '0.95'
]
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'org.apache.logging.log4j') {
details.useVersion '2.17.0'
}
}
}
dependencies {
annotationProcessor "org.projectlombok:lombok:$versions.lombok"
aspects "org.springframework:spring-aspects"
implementation "org.aspectj:aspectjrt"
implementation "org.aspectj:aspectjtools"
implementation "org.aspectj:aspectjweaver"
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-json'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework:spring-jms'
implementation 'org.springframework.data:spring-data-envers'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-hibernate5'
implementation ("org.hibernate:hibernate-spatial") {
exclude group: 'org.postgresql', module: 'postgresql'
}
implementation "org.hibernate:hibernate-search-orm:$versions.hibernatesearch"
implementation "com.vladmihalcea:hibernate-types-5:$versions.hibernatetypes"
implementation "com.microsoft.azure:azure-storage:$versions.azurestorage"
implementation "com.microsoft.graph:microsoft-graph:$versions.microsoftgraph"
implementation "org.projectlombok:lombok:$versions.lombok"
implementation 'org.flywaydb:flyway-core'
implementation "org.apache.tika:tika-core:$versions.tika"
implementation "com.bedatadriven:jackson-datatype-jts:$versions.jacksondatatypejts"
implementation "org.reflections:reflections:$versions.reflections"
implementation "com.google.guava:guava:$versions.guava"
implementation 'javax.xml.bind:jaxb-api'
implementation 'org.glassfish.jaxb:jaxb-runtime'
implementation "commons-io:commons-io:$versions.commonsio"
implementation "com.microsoft.sqlserver:mssql-jdbc:$versions.mssqljdbc"
implementation "com.monitorjbl:xlsx-streamer:$versions.xlxsstreamer"
implementation "io.springfox:springfox-swagger2:$versions.swagger"
implementation "io.springfox:springfox-swagger-ui:$versions.swagger"
implementation "com.bp:access-token-validator:$versions.accesstokenvalidator"
implementation "com.bp:access-token-on-behalf-of:$versions.onbehalfof"
implementation "com.bp:access-token-client-credentials:$versions.clientcredentials"
implementation "com.microsoft.azure:azure-keyvault:$versions.azurekeyvault"
implementation "com.microsoft.azure:azure:$versions.azure"
implementation "com.microsoft.azure:applicationinsights-web:$versions.applicationinsights"
implementation "com.microsoft.azure:applicationinsights-logging-logback:$versions.applicationinsights"
implementation 'org.jsoup:jsoup:1.11.2' // safe html
implementation ("commons-beanutils:commons-beanutils:$versions.beanutils") {
exclude group: 'commons-logging', module: 'commons-logging'
}
implementation 'org.slf4j:jcl-over-slf4j'
implementation "com.github.dozermapper:dozer-spring-boot-starter:$versions.dozer"
implementation "org.apache.qpid:qpid-jms-client:$versions.qpid"
implementation "de.danielbechler:java-object-diff:$versions.javaobjectdiff"
testAnnotationProcessor "org.projectlombok:lombok:$versions.lombok"
testimplementation ('org.springframework.boot:spring-boot-starter-test')
testimplementation 'com.vmlens:concurrent-junit:1.0.2'
testimplementation 'io.github.benas:random-beans:3.7.0'
testimplementation "com.flipkart.zjsonpatch:zjsonpatch:0.4.11"
testRuntimeOnly 'com.h2database:h2'
integrationAnnotationProcessor "org.projectlombok:lombok:$versions.lombok"
integrationimplementation 'org.springframework.boot:spring-boot-starter-test'
integrationimplementation 'org.springframework.boot:spring-boot-starter-jdbc'
integrationimplementation 'org.springframework.boot:spring-boot-starter-json'
integrationimplementation "org.projectlombok:lombok:$versions.lombok"
integrationimplementation "io.rest-assured:rest-assured"
integrationimplementation "com.monitorjbl:xlsx-streamer:$versions.xlxsstreamer"
integrationimplementation "com.microsoft.sqlserver:mssql-jdbc:$versions.mssqljdbc"
integrationimplementation "com.google.guava:guava:$versions.guava"
integrationimplementation "commons-beanutils:commons-beanutils:$versions.beanutils"
integrationimplementation ('org.hibernate:hibernate-spatial') {
exclude group: 'org.postgresql', module: 'postgresql'
}
integrationimplementation "com.bedatadriven:jackson-datatype-jts:$versions.jacksondatatypejts"
integrationimplementation "org.awaitility:awaitility:$versions.awaitility"
integrationimplementation "org.reflections:reflections:$versions.reflections"
integrationimplementation "com.github.dozermapper:dozer-spring-boot-starter:$versions.dozer"
integrationimplementation "com.flipkart.zjsonpatch:zjsonpatch:0.4.11"
}
compileJava {
println 'Java Version: ' + JavaVersion.current()
println 'Java Source Compatibility: ' + sourceCompatibility
println 'Java Target Compatibility: ' + targetCompatibility
doLast {
ant.taskdef(resource: 'org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties', classpath: configurations.compile.asPath)
ant.iajc(inpath: sourceSets.main.output.classesDirs.asPath, classpath: configurations.compile.asPath, aspectPath: configurations.aspects.asPath, destDir: sourceSets.main.output.classesDirs.asPath)
}
}
task integrationTest(type: Test) {
testClassesDirs = sourceSets.integration.output
classpath = sourceSets.integration.runtimeClasspath
outputs.upToDateWhen { false }
}
tasks.withType(Test) {
reports.html.destination = file("${reporting.baseDir}/${name}")
minHeapSize = "512m"
maxHeapSize = "2g"
jvmArgs = [
"-Dfile.encoding=UTF-8",
"-Duser.timezone=UTC"
]
}
bootRun {
if (project.hasProperty('jvmArgs')) {
jvmArgs = (project.jvmArgs.split("\\s+" as Closure) as List)
} else {
jvmArgs = [
"-Dapp.security.enable=true",
"-Djava.net.preferIPv4Stack=true",
"-Dfile.encoding=UTF-8",
"-Duser.timezone=UTC"
]
}
}
def createLocalDatabaseSql = "create database hopper\n" +
"go\n" +
"create login bp with password = 'bp', check_policy = off\n" +
"go\n" +
"use hopper\n" +
"go\n" +
"create user bp for login bp\n" +
"go\n" +
"sp_addrolemember 'db_owner', 'bp'\n" +
"go\n" +
"exit\n"
def dropLocalDatabaseSql = "drop database hopper\n" +
"go\n" +
"drop login bp\n" +
"go\n" +
"exit\n"
task createLocalDatabase(type: Exec) {
standardInput = new ByteArrayInputStream(createLocalDatabaseSql.getBytes('UTF-8'))
commandLine 'cmd', '/c', 'sqlcmd'
}
task createLocalDatabaseDocker(type: Exec) {
standardInput = new ByteArrayInputStream(createLocalDatabaseSql.getBytes('UTF-8'))
commandLine 'sqlcmd', '-U', 'sa', '-P', 'Passw0rd'
}
task dropLocalDatabase(type: Exec) {
standardInput = new ByteArrayInputStream(dropLocalDatabaseSql.getBytes('UTF-8'))
commandLine 'cmd', '/c', 'sqlcmd'
}
task dropLocalDatabaseDocker(type: Exec) {
standardInput = new ByteArrayInputStream(dropLocalDatabaseSql.getBytes('UTF-8'))
commandLine 'sqlcmd', '-U', 'sa', '-P', 'Passw0rd'
}
eclipse {
classpath {
plusConfigurations.add configurations.integrationCompile
plusConfigurations.add configurations.integrationRuntime
}
}

multi-module Gradle project: webjar doesn't get placed in "META-INF/resources"

I am trying to combine a Spring Boot backend api and a React frontend app into one single jar.
I was able to build a jar file containing both by following this article (https://medium.com/xebia-engineering/a-minimalistic-guide-to-building-and-deploying-monolithic-spring-boot-react-applications-39440035b27) but the frontend jar ends up in BOOT-INF/lib/frontend.jar instead of META-INF/resources. How can I create a jar file with the webjar in the right directory so it can render a React page?
frontend/build.gradle
plugins {
id "com.moowork.node" version "1.3.1"
}
apply plugin: "java"
apply plugin: "com.moowork.node"
node {
version = "12.9.1"
download = true
}
task bundle(type: NpmTask, dependsOn: npmInstall) {
args = ["run", "build"]
}
task uiTest(type: NpmTask) {
environment = ["CI": "true"]
args = ["run", "test"]
}
task run(type: NpmTask) {
args = ["start"]
}
check.dependsOn(test)
jar.dependsOn(bundle)
task webjar(type: Jar) {
from(fileTree("build")) {
into "META-INF/resources"
}
}
check.dependsOn(test)
jar.dependsOn(bundle)
jar.finalizedBy("webjar")
backend/build.gradle
plugins {
id 'org.springframework.boot' version '2.1.5.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
apply plugin: 'maven'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
jar {
manifest {
attributes "Main-Class": "com.example.kasahararestapi.StockCheckAppApplication"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Test.class" // whatever Ant pattern matches your test class files
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'mysql:mysql-connector-java'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.social:spring-social-github:1.0.0.M4'
implementation 'commons-io:commons-io:2.6'
implementation 'org.apache.commons:commons-lang3:3.0'
implementation 'io.jsonwebtoken:jjwt:0.9.0'
implementation platform('com.amazonaws:aws-java-sdk-bom:1.11.807')
implementation 'com.amazonaws:aws-java-sdk-s3'
implementation 'org.springframework.boot:spring-boot-starter-mail:1.2.0.RELEASE'
implementation 'org.modelmapper:modelmapper:2.3.5'
testCompile group: 'junit', name: 'junit', version: '4.11'
implementation project(path: ':frontend', configuration: 'default')
}
setting.gradle
pluginManagement {
repositories {
gradlePluginPortal()
}
}
rootProject.name = 'stock_check_app'
include 'backend'
include 'frontend'

ProtoBuffer files generated after building project missing dependencies

I am trying to create implement client-server communication with the help of grpc
proto file -
syntax="proto3";
package com.project.grpc.roleservice;
message UserRequest {
string userName=1;
}
message RoleReply {
string userRole=1;
}
service UserRoleFromServer{
rpc getRoleUser(stream UserRequest) returns (stream RoleReply);
}
Gradle build -
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.5")
}
}
plugins {
id 'java'
}
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.google.protobuf'
group 'com.project.grpc.roleservice'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.5.1-1"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.16.1'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-web')
compile( 'io.grpc:grpc-netty-shaded:1.16.1')
compile('io.grpc:grpc-protobuf:1.16.1')
compile('io.grpc:grpc-stub:1.16.1')
compile 'io.github.lognet:grpc-spring-boot-starter:3.0.0'
runtime('org.springframework.boot:spring-boot-devtools')
runtime('mysql:mysql-connector-java')
testCompile (group: 'junit', name: 'junit', version: '4.12')
}
After building the project all the files are generated in a build folder and a UserRoleFromServerGrpc is generated which I want to extend and implement in my server-service file
But The UserRoleFromServerGrpc has a lot of errors it asks for following dependencies
Streamobserver needs io.grpc:grpc-stub:1.16.1 ,grpc-core
Add io.grpc:grpc-stub:1.16.1 to classpath
but I have already defined these dependencies in gradle build
How to resolve this issue
Screenshot of IDE

Enforcing the order of deployment in gradle

This is my build.gradle file
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.moowork.gradle:gradle-grunt-plugin:0.13'
classpath "gradle.plugin.com.github.scobal.eslint:gradle-eslint-plugin:1.0.1"
}
}
plugins{
id "com.moowork.grunt" version "0.13"
id "com.moowork.node" version "0.13"
}
// apply all plug-ins
apply plugin: 'com.moowork.grunt'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
apply plugin: "com.github.scobal.eslint"
sourceCompatibility = 1.8
//version = '24.1.1.0'
war.doFirst{
deleteFiles()
grunt_build()
grunt_compile()
}
task deleteFiles(type: Delete){
delete fileTree("${System.properties['TOMCAT_HOME']}/webapps"){
include '**/*.war'
}
}
task deployToTomcat(type: Copy) {
from war.archivePath
into "${System.properties['TOMCAT_HOME']}/webapps"
}
deployToTomcat.doFirst{
war()
}
clean.doFirst{
deleteFiles
}
eslint {
inputs = ["./src/**/*.js"]
}
// exclude the files we don't want to deliver
// TODO - is there an easier way to exclude all directories under js??? We don't want any of them.
war {
exclude('src/js/main.js')
exclude('src/js/actions')
exclude('src/js/api')
exclude('src/js/components')
exclude('src/js/constants')
exclude('src/js/dispatcher')
exclude('src/js/stores')
}
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart' //,
//'Implementation-Version': version
}
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile("org.springframework:spring-webmvc:4.0.3.RELEASE")
compile("com.fasterxml.jackson.core:jackson-core:2.7.4")
compile("com.fasterxml.jackson.core:jackson-annotations:2.7.4")
compile("com.fasterxml.jackson.core:jackson-databind:2.7.4")
compile("org.darkphoenixs:log4j:1.2.17")
compile files('libs/opla230.jar')
testCompile group: 'junit', name: 'junit', version: '4.+'
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
The problem that's happening is that the deployToTomcat is running first and deploying an old war on the tomcat. After that the war task of the war plugin runs and generates a new war which never gets deployed. Can someone help me with the enforcing of the order of these actions.
You need to add "dependsOn war" in your deployToTomcat task.

Categories

Resources