Spring boot repackage: Jar task not repackaged (didn't match withJarTask) - grails

I have a new Grails 3.1.7 project compiled by gradle wrapper. The project is just the base project created by: grails create-app
When I run:
./gradlew --info clean jar bootRepackage
I see the following output during the last part of the build
:jar (Thread[main,5,main]) started.
:jar
Executing task ':jar' (up-to-date check took 0.023 secs) due to:
Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.jar has changed.
Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.jar has been removed.
:jar (Thread[main,5,main]) completed. Took 0.259 secs.
:findMainClass (Thread[main,5,main]) started.
:findMainClass
Executing task ':findMainClass' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:findMainClass (Thread[main,5,main]) completed. Took 0.041 secs.
:war (Thread[main,5,main]) started.
:war
Executing task ':war' (up-to-date check took 0.039 secs) due to:
Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.war has changed.
Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.war has been removed.
:war (Thread[main,5,main]) completed. Took 4.305 secs.
:bootRepackage (Thread[main,5,main]) started.
:bootRepackage
Executing task ':bootRepackage' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
Jar task not repackaged (didn't match withJarTask): task ':jar'
Jar task not repackaged (didn't match withJarTask): task ':pathingJar'
Jar task not repackaged (didn't match withJarTask): task ':pathingJarCommand'
Setting mainClass: helloworld.Application
:bootRepackage (Thread[main,5,main]) completed. Took 0.94 secs.
BUILD SUCCESSFUL
What is happening in the repackage task?
What does this mean?
Jar task not repackaged (didn't match withJarTask): task ':jar'
gradle.properties:
grailsVersion=3.1.7
gradleWrapperVersion=2.13
build.gradle:
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.8.2"
classpath "org.grails.plugins:hibernate4:5.0.6"
}
}
version "0.1"
group "helloworld"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
console "org.grails:grails-console"
profile "org.grails.profiles:web:3.1.7"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.8.2"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}
assets {
minifyJs = true
minifyCss = true
}
The code for this example is at: https://github.com/liftyourgame/helloworld

prior to grails-3.1.5, the bootRepackage task has processed all jar tasks which was undesired for pathing jars.
now it processes only the war task if the War plugin is applied (by default).
also, a gradle(w) assemble (which is also used by grails war, for example) builds only a war (no jar) artefact if the War plugin is applied. the same applies to spring-boot.
but that is usually just fine because the war is also executable (i.e. java -jar my.war).
so if you really want to build that jar artefact and that should be subject to repackaging, reconfigure the bootRepackage task accordingly:
bootRepackage.withJarTask = jar
however - if there is no good reason against it - i would say its better to stick to the war file and use that as executable. or remove the War plugin which makes assemble and bootRepackage default to build/process the jar artefact.

Related

Grails - DataTables plugin doesn't exist any longer?

I tried to add --compile "org.grails.plugins:grails-datatables:0.14"-- and also
--compile "org.grails.plugins:grails-datatables:0.15" but none of them where found.
I want to use it with GRAILS-4.0.3 but it doesn't seem possible, is it abandoned in grails?
Ok, I tested with the new URL:s. Not sure if I did it correctly but it failed.
Error initializing classpath: Could not find org.grails.plugins:grails-datatables:0.15.Searched in the following locations:
file:/C:/Users/Lars/.m2/repository/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.pom
file:/C:/Users/Lars/.m2/repository/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.jar
https://repo.grails.org/grails/core/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.pom
https://repo.grails.org/grails/core/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.jar
https://repo.grails.org/grails/plugin-releases-local/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.pom
https://repo.grails.org/grails/plugin-releases-local/org/grails/plugins/grails-datatables/0.15/grails-datatables-0.15.jar
It looks like I did it correct but it did not find it on the given URL.
build.gradle Looks like this in the beginning:
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2"
}
}
version "0.1"
group "test"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://repo.grails.org/grails/plugin-releases-local" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.5.Final"
compile "org.grails.plugins:gsp"
compile 'org.grails.plugins:quartz:2.0.12'
console "org.grails:grails-console"
compile "org.grails.plugins:grails-datatables:0.15"
Gradle.properties looks like this:
grailsVersion=3.3.0
gormVersion=6.1.6.RELEASE
gradleWrapperVersion=3.5
But at this link: https://mvnrepository.com/artifact/org.grails.plugins/grails-datatables/0.15
I found a repository that worked:
Note: this artifact is located at Grails Plugins repository (https://repo.grails.org/grails/plugins/)
I tried to add --compile "org.grails.plugins:grails-datatables:0.14"--
and also --compile "org.grails.plugins:grails-datatables:0.15" but
none of them where found.
You have not indicated which repositories you attempted to resolve those from, but those are available:
https://mvnrepository.com/artifact/org.grails.plugins/grails-datatables/0.14
https://mvnrepository.com/artifact/org.grails.plugins/grails-datatables/0.15
https://repo.grails.org/grails/plugins-releases-local/org/grails/plugins/grails-datatables/0.15/
https://repo.grails.org/grails/plugins-releases-local/org/grails/plugins/grails-datatables/0.14/
I want to use it with GRAILS-4.0.3 but it doesn't seem possible, is it
abandoned in grails?
As far as I know there is not a version of the plugin that is compatible with Grails 4.0.3. The plugin is of course open source (https://bitbucket.org/ben-wilson/grails-datatables/src/master/).

Grails with Vaadin 8 - 'Failed to load the widgetset"

I am a newbie in the areas in Grails and Vaadin 8, and I’m having a bit of trouble trying to add widgets to my Vaadin/Grails application.
To begin, I created a grails/Vaadin app using the me.przepiora.vaadin-grails:web-vaadin8:0.3 profile. I edited the build.gradel file, as advised and
ran the command ”gradle wrapper --gradle-version 4.0” (again, as advised by the profile setup).
Here is my build.gradle after applying the edit:
apply plugin:"com.devsoap.plugin.vaadin"
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://dl.bintray.com/macprzepiora/gradle-plugins/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.devsoap.plugin:gradle-vaadin-plugin:1.2.0.beta1-macprzepiora2"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8"
}
}
version "0.1"
group "foobar"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "com.vaadin:vaadin-spring-boot-starter:2.+"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.5.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "me.przepiora.vaadin-grails:web-vaadin8:0.3"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.8"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails:grails-web-testing-support"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
plugins {
id 'com.devsoap.plugin.vaadin' version '1.3.1'
}
assets {
minifyJs = true
minifyCss = true
}
The resulting grails/Vaadin app worked fine, displaying a button which , when pressed, displayed an error message.
I then tried to enhance the app slightly, by replacing the button with a Vaadin Tree, backup by a TreeData instance.
Unfortunately, when I did this, I got the error message:
“Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.vaadin.ui.Tree Check its component connector's #Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.”
After a google search I found something that appeared to be related at:
How do I fix 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.vaadin.addon.charts.Chart
Based on this, I added the line #Widgetset("AppWidgetset") to my GrailsUI class (the only class in my project that inherits from com.vaadin.ui.UI).
After doing this, I get a new runtime error:
“Failed to load the widgetset: ./VAADIN/widgetsets/AppWidgetset/AppWidgetset.nocache.js?1525623851485”
I feel so frustrated - it feels like i’m really close to a working application, if only I knew the magi incantation :-(

Grails 3.x update - bootRun failed

I have upgraded small application from Grails 2.2 to Grails 3.2.3. After resolving compilation issues everything looks OK, but bootRun is failing and there is no obvious clue why.
My build.gradle:
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
maven { url "http://repository.jboss.com/maven2/" }
maven { url "http://repo1.maven.org/maven2/" }
maven { url "http://repo.spring.io/milestone/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.6"
classpath "org.grails.plugins:hibernate5:6.0.4"
}
}
version "0.1"
group "testmonitor"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "http://repository.jboss.com/maven2/" }
maven { url "http://repo1.maven.org/maven2/" }
maven { url "http://repo.spring.io/milestone/" }
}
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.2.Final"
compile "org.hibernate:hibernate-ehcache:5.1.2.Final"
compile 'org.grails.plugins:spring-security-core:3.1.1'
compile "org.grails.plugins:quartz:2.0.1"
compile 'org.grails:grails-datastore-rest-client'
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.6"
runtime "com.h2database:h2"
compile 'org.apache.commons:commons-math3:3.6.1'
compile group: 'org.codehaus.groovy.modules.http-builder', name: 'http-builder', version: '0.7.1'
compile 'net.sf.opencsv:opencsv:2.3'
console "org.grails:grails-console"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.6"
runtime 'mysql:mysql-connector-java:5.1.29'
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
bootRun {
jvmArgs = ['-Dspring.output.ansi.enabled=always']
}
assets {
minifyJs = true
minifyCss = true
}
A log with gradle --debug (cant see any issue here) can be downloaded from Sharepoint.
I use IntelliJ IDEA 2016.3, when I run grails run-app I am getting the same result. I can not find any option to log/info grails command.
[running grails run-app][1]
UPDATE: now grails run-app seems OK, but htpp 404 is returned.
you need to clear the old gradle cache too. follow the below link. I was getting almost same errors.
https://stackoverflow.com/a/39462689/3711185

Class Cast Exception Building WAR file in Grails 3.1.11 Using asset-pipeline and bootstrap

I'm building a grails application using bootstrap and asset-pipeline. Everything works great in dev but when I build a war file I get a ClassCastException
{ viops } » gradle war
/c/VitalDev/ProfessionalServices/dev/trunk/viops :assetCompile
Processing File 1 of 164 - bower.json
Writing File Processing File 2 of 164 - data/flot-data.js Minifying
File Writing File Processing File 3 of 164 - data/morris-data.js
Minifying File Writing File Processing File 4 of 164 -
dist/css/sb-admin-2.css Minifying File Writing File Processing File 5
of 164 - dist/css/sb-admin-2.min.css Writing File Processing File 6 of
164 - dist/js/sb-admin-2.js Minifying File Writing File Processing
File 7 of 164 - dist/js/sb-admin-2.min.js Writing File Processing File
8 of 164 - gulpfile.js :assetCompile FAILED FAILURE: Build failed with
an exception.
What went wrong: Execution failed for task ':assetCompile'.
Cannot cast object '[Digest Input Stream] MD5 Message Digest from SUN,
' with class 'java.security.DigestInputStream' to class
'java.io.ByteArrayInputStream' Try: Run with --stacktrace option to
get the stack trace. Run with --info or --debug option to get more log
output.
BUILD FAILED
Here's the stacktrace:
Exception is: org.gradle.api.tasks.TaskExecutionException: Execution
failed for task ':assetCompile'. at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gra
dle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at
org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at
org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at
org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at
org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at
org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at
org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at
org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at
org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at
org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at
org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at
org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at
org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at
org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at
org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at
org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22) at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at
org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at
org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at
org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at
org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at
org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at
org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at
org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at
org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at
org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at
org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at
org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at
org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at
org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at
org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at
org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at
org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at
org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at
org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
at
org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
at
org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at
org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at
org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
at
org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.Main.doAction(Main.java:33) at
org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at
org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at
org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23) Caused by:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot
cast object '[Digest Input Stream] MD5 Message Digest from SUN, ' with
class 'java.security.DigestInputStream' to class
'java.io.ByteArrayInputStream' at
asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy:152)
at
asset.pipeline.processors.JsRequireProcessor.encapsulateModule(JsRequireProcessor.groovy:115)
at
asset.pipeline.processors.JsRequireProcessor.appendModule(JsRequireProcessor.groovy:103)
at
asset.pipeline.processors.JsRequireProcessor.this$4$appendModule(JsRequireProcessor.groovy)
at
asset.pipeline.processors.JsRequireProcessor$_process_closure1.doCall(JsRequireProcessor.groovy:62)
at
asset.pipeline.processors.JsRequireProcessor.process(JsRequireProcessor.groovy:37)
at
asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy:171)
at
asset.pipeline.AbstractAssetFile.processedStream(AbstractAssetFile.groovy)
at
asset.pipeline.DirectiveProcessor.fileContents(DirectiveProcessor.groovy:307)
at
asset.pipeline.DirectiveProcessor$fileContents$0.callCurrent(Unknown
Source) at
asset.pipeline.DirectiveProcessor.loadContentsForTree(DirectiveProcessor.groovy:129)
at
asset.pipeline.DirectiveProcessor.compile(DirectiveProcessor.groovy:67)
at asset.pipeline.DirectiveProcessor$compile.call(Unknown Source) at
asset.pipeline.AssetCompiler.compile(AssetCompiler.groovy:147) at
asset.pipeline.AssetCompiler$compile.call(Unknown Source) at
asset.pipeline.gradle.AssetCompile.compile(AssetCompile.groovy:221) at
org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75) at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:228)
at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at
org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at
org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:621)
at
org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:604)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 57 more Total time: 22.617 secs
build.gradle:
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
// classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.10.2"
classpath "org.grails.plugins:hibernate4:5.0.10"
classpath "org.grails.plugins:views-gradle:1.0.12"
classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.11.2'
classpath 'com.bertramlabs.plugins:less-asset-pipeline:2.11.2'
classpath 'com.bertramlabs.plugins:asset-pipeline-core:2.11.2' //Add this for some bug fixes
classpath "com.bertramlabs.plugins:asset-pipeline-grails:2.11.2"
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'log4j') {
details.useTarget "org.slf4j:log4j-over-slf4j:1.7.5"
}
if (details.requested.name == 'commons-logging') {
details.useTarget "org.slf4j:jcl-over-slf4j:1.7.5"
}
}
}
version "0.1"
group "viops"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}
dependencies {
//This top section pulls out Grails Logback logging solution and
//replaces it with log4j2
// added the new way using Log4j2, yes, spring makes it easy
compile "org.springframework.boot:spring-boot-starter-log4j2"
// changed spring-boot-autoconfigure so that it would not
// pull in the logback binding/implementation
compile('org.springframework.boot:spring-boot-autoconfigure') {
exclude group:'ch.qos.logback', module:'logback-classic'
}
compile('org.springframework.boot:spring-boot-starter-actuator') {
exclude group:'ch.qos.logback', module:'logback-classic'
}
// and finally, added the log4j2 binding/implementation
compile "org.apache.logging.log4j:log4j-api:2.5"
compile "org.apache.logging.log4j:log4j-core:2.5"
compile "org.grails:grails-core"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-codecs"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails:grails-dependencies" //
compile "org.grails.plugins:scaffolding" //
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-datasource"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-async"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:views-json"
console "org.grails:grails-console"
runtime "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.2"
// runtime "org.grails.plugins:asset-pipeline:3.0.1"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.2"
runtime 'com.bertramlabs.plugins:asset-pipeline-core:2.11.2' //Add this for some bug fixes
runtime 'com.bertramlabs.plugins:less-asset-pipeline:2.11.2'
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.4'
//profile "org.grails.profiles:rest-api"
profile "org.grails.profiles:web"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-datastore-rest-client"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
assets {
minifyJs = true
minifyCss = true
excludes = ['**/*.less','bootstrap-3.3.2/**/*'] //Example Exclude GLOB pattern
includes = ['application.less','bootstrap-3.3.2/fonts/*']
}
I don't know if I'm missing something or if it's a bug. Any help would be appreciated.
Update: I'm now using 3.1.12 successfully.
I started playing with versions and combinations and wound up with only
classpath 'com.bertramlabs.plugins:asset-pipeline-gradle:2.9.5
`and now it seems to work. After restricting to just this item in the classpath, I walked the version back one by one until I arrived at 2.9.5.
I still am not sure exactly which item this created a problem with or which version of which other package I'm using.

how to get GWT work with Grails 3

I am using Grails latest version i.e 3.1.3, and GWT
I have gone through the gwt/grails plugin and their tutorials , but All of this is for old version of grails , where we had "BuildConfig.groovy" and the format looks different.
Now as we have build.gradle , I cant find a way to put gwt plugin there
What i have tried is : adding
compile "org.grails.plugins:gwt:1.0.2"
now when i run command:
grails create-gwt-module
I get the exception:
Could not resolve all dependencies for configuration ':runtime'.
> Could not find org.grails.plugins:resources:1.2.
Searched in the following locations:
file:/C:/Users/Junaid/.m2/repository/org/grails/plugins/resources/1.2/r
sources-1.2.pom
file:/C:/Users/Junaid/.m2/repository/org/grails/plugins/resources/1.2/r
sources-1.2.zip
https://repo.grails.org/grails/core/org/grails/plugins/resources/1.2/re
ources-1.2.pom
https://repo.grails.org/grails/core/org/grails/plugins/resources/1.2/re
ources-1.2.zip
Required by:
helloworld2:helloworld2:0.1 > org.grails.plugins:gwt:1.0.2
this is my build.gradle:
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.5.0"
classpath "org.grails.plugins:hibernate4:5.0.2"
}
}
version "0.1"
group "helloworld2"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:gwt:2.6.0"
console "org.grails:grails-console"
profile "org.grails.profiles:web:3.1.3"
runtime "org.grails.plugins:asset-pipeline"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
}
task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}
assets {
minifyJs = true
minifyCss = true
}
Did you try to get compile "org.grails.plugins:gwt:1.0.3", the latest version of plugin?
And if it can't be downloaded automatically to download it manually from repo and put in one of searched locations in your local maven repository?
In official plugin docs you can read:
In Grails 2.x plugins were packaged as ZIP files, however in Grails
3.x plugins are simple JAR files that can be added to the classpath of the IDE.
So try to pack plugin to jar according to official deployment docs:
Another way to deploy in Grails 3.0 or above is to use the new
support for runnable JAR or WAR files. To create runnable archives,
run grails package:
grails package

Resources