How to invoke exe from the gradle task - gradle

I need to invoke the build.exe file from the gradle task. I have tried the following option but it always results in the Build Failure with the following reason.
task buildIA() {
doFirst {
println "Executing Install Anywhere Build"
}
doLast {
exec {
executable 'C:\\Program Files (x86)\\InstallAnywhere 2018\\build.exe'
args (['C:\\Users\\test.iap_xml', '+lv', '+wv'])
}
}
}
output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildIA'.
> A problem occurred starting process 'command 'C:\Program Files (x86)\InstallAnywhere 2018\build.exe''
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Note: If I manually run "C:\\Program Files (x86)\\InstallAnywhere 2018\\build.exe" C:\\Users\\test.iap_xml +lv +wv from command prompt it is working fine.
StackTrace: Below is the stacktrace.
gradlew.bat buildIA --stacktrace
> Task :buildIA FAILED
Executing Install Anywhere Build
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildIA'.
> A problem occurred starting process 'command 'C:\Program Files (x86)\InstallAnywhere 2018\build.exe''
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':buildIA'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:156)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program Files (x86)\InstallAnywhere 2018\build.exe''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:237)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:214)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:364)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:87)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
... 3 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'C:\Program Files (x86)\InstallAnywhere 2018\build.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:98)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:71)
... 4 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files (x86)\InstallAnywhere 2018\build.exe" (in directory "C:\Users\nc665504\git\PAM-SC-MigrationUtility\SAMDataExtraction"): CreateProcess error=740, The requested operation requires elevation
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 8 more
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
... 9 more
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed

Try this (equal sign added after executable and args):
task buildIA() {
doFirst {
println "Executing Install Anywhere Build"
}
doLast {
exec {
executable = 'C:\\Program Files (x86)\\InstallAnywhere 2018\\build.exe'
args = ['C:\\Users\\test.iap_xml', '+lv', '+wv']
}
}
}
Another option is to use a commandLine like this
task buildIA() {
doFirst {
println "Executing Install Anywhere Build"
}
doLast {
exec {
commandLine "C:\\Program Files (x86)\\InstallAnywhere 2018\\build.exe", "C:\\Users\\test.iap_xml", "+lv", "+wv"
}
}
}

Related

How to run .exe file in specific location using gradle

I need to run a .exe file which is in specific location.
This is the code I'm used
tasks.register( 'buildComponents', Exec )
{
dependsOn createSetupIni
doLast
{
exec
{
workingDir = file('tools/configBuild')
executable = 'ConfigBuilder.exe'
args = [ "${configLocation}/setup.ini", "${logFilePath}/configBuild"]
}
}
}
But I'm getting below error during the execution.
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'ConfigBuilder.exe''
at org.gradle.process.internal.DefaultExecHandle.execExceptionFor(DefaultExecHandle.java:232)
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:209)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:356)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'ConfigBuilder.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:97)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:70)
... 4 more
Caused by: java.io.IOException: Cannot run program "ConfigBuilder.exe" (in directory "<full path>\tools\configBuild"): CreateProcess error=2, The system cannot find the file specified
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 8 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
... 9 more
Any Idea about this?
Sloved it by removing exec {} block.

RUST on windows : getting LINK : fatal error LNK1181 error

I am a complete beginner (following this course actually) regarding Rust language and i was wondering if it was possible to create an app for Windows involving a mqtt client.
I created my project using cargo new testmqtt --bin,
my toml file is
[package]
name = "testmqtt"
version = "0.1.0"
authors = ["Pierre"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
mosquitto-client = "0.1.5"
Main.rs file is exactly the first one found here.
extern crate mosquitto_client as mosq;
use mosq::Mosquitto;
fn main() {
let m = Mosquitto::new("test");
m.will_set("test/will",b"finished!",0,false).expect("can't set will");
m.connect("localhost",1883).expect("can't connect");
let bonzo = m.subscribe("bonzo/#",0).expect("can't subscribe to bonzo");
let frodo = m.subscribe("frodo/#",0).expect("can't subscribe to frodo");
// not interested in any retained messages!
let mut mc = m.callbacks(());
mc.on_message(|_,msg| {
if ! msg.retained() {
if bonzo.matches(&msg) {
println!("bonzo {:?}",msg);
} else
if frodo.matches(&msg) {
println!("frodo {:?}",msg);
m.disconnect().unwrap();
}
}
});
m.loop_forever(200).expect("broken loop");
}
When doing cargo run, i do have an error saying more or less that i have to include mosquitto.lib file.
Compiling testmqtt v0.1.0 (C:\Users\Pierre\rust\testmqtt)
Finished dev [unoptimized + debuginfo] target(s) in 3.43s
Running `target\debug\testmqtt.exe`
Hello, world!
PS C:\Users\Pierre\rust\testmqtt> cargo run
Updating crates.io index
Compiling mosquitto-client v0.1.5
Compiling testmqtt v0.1.0 (C:\Users\Pierre\rust\testmqtt)
error: linking with `link.exe` failed: exit code: 1181
|
= note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.18yxopwcqksqllf0.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.26hriqf9eoqoz70e.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.287dmq688xsz3isv.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2e77zj76zbvh065j.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2huuzosvc51r1ocl.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2o9r9r2t2clr39wq.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2wggiqwux76jad1h.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3mqzooten3ugyse9.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3vqvdeaqidai2p26.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4fnmrub2ky4biwf5.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4tdiuzs0kqadbi75.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4u40iyf9g9kmiphf.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.51m4wneyq731nq60.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.5d67na1jjhizscb4.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.ap2kea3xxb47i5p.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.h5xgbt8abre0rtw.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.vlg3p2hoy45m5m6.rcgu.o" "/OUT:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.exe" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.49ivjbnnhficmjo4.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/LIBPATH:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\libmosquitto_client-23967bfdaa3a5433.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-8864852919b3dde3.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-60bab00b06422126.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-e90b3ab99b608a07.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-d9b7b1604d471c6c.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-a439eac7fda93b7a.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-058c975bf38e4686.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-711d56157cf28645.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-d802c196c150a787.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-7147008fc56d32b8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-57b2ee5c835455f8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-6391a360e3eeafba.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-6c8df881cdc2afb2.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-f998976453a15b70.rlib" "mosquitto.lib" "c.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: Non-UTF-8 output: LINK : fatal error LNK1181: impossible d\'ouvrir le fichier en entr\xe9e \'mosquitto.lib\'\r\n
error: aborting due to previous error
error: Could not compile `testmqtt`.
To learn more, run the command again with --verbose.
Here is the verbose ouput
To learn more, run the command again with --verbose.
PS C:\Users\Pierre\rust\testmqtt> cargo run --verbose
Fresh mosquitto-client v0.1.5
Compiling testmqtt v0.1.0 (C:\Users\Pierre\rust\testmqtt)
Running `rustc --edition=2018 --crate-name testmqtt src\main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e2a79a549b8dacef -C extra-filename=-e2a79a549b8dacef --out-dir C:\Users\Pierre\rust\testmqtt\target\debug\deps -C incremental=C:\Users\Pierre\rust\testmqtt\target\debug\incremental -L dependency=C:\Users\Pierre\rust\testmqtt\target\debug\deps --extern mosquitto_client=C:\Users\Pierre\rust\testmqtt\target\debug\deps\libmosquitto_client-23967bfdaa3a5433.rlib`error: linking with `link.exe` failed: exit code: 1181
|
= note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.18yxopwcqksqllf0.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.26hriqf9eoqoz70e.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.287dmq688xsz3isv.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2e77zj76zbvh065j.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2huuzosvc51r1ocl.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2o9r9r2t2clr39wq.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.2wggiqwux76jad1h.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3mqzooten3ugyse9.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.3vqvdeaqidai2p26.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4fnmrub2ky4biwf5.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4tdiuzs0kqadbi75.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.4u40iyf9g9kmiphf.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.51m4wneyq731nq60.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.5d67na1jjhizscb4.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.ap2kea3xxb47i5p.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.h5xgbt8abre0rtw.rcgu.o" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.vlg3p2hoy45m5m6.rcgu.o" "/OUT:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.exe" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\testmqtt-e2a79a549b8dacef.49ivjbnnhficmjo4.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/LIBPATH:C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\Pierre\\rust\\testmqtt\\target\\debug\\deps\\libmosquitto_client-23967bfdaa3a5433.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-8864852919b3dde3.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-60bab00b06422126.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libbacktrace-e90b3ab99b608a07.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-d9b7b1604d471c6c.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-a439eac7fda93b7a.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-058c975bf38e4686.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-711d56157cf28645.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-d802c196c150a787.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-7147008fc56d32b8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-57b2ee5c835455f8.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-6391a360e3eeafba.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-6c8df881cdc2afb2.rlib" "C:\\Users\\Pierre\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-f998976453a15b70.rlib" "mosquitto.lib" "c.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: Non-UTF-8 output: LINK : fatal error LNK1181: impossible d\'ouvrir le fichier en entr\xe9e \'mosquitto.lib\'\r\n
error: aborting due to previous error
error: Could not compile `testmqtt`.
Caused by:
process didn't exit successfully: `rustc --edition=2018 --crate-name testmqtt src\main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e2a79a549b8dacef -C extra-filename=-e2a79a549b8dacef --out-dir C:\Users\Pierre\rust\testmqtt\target\debug\deps -C incremental=C:\Users\Pierre\rust\testmqtt\target\debug\incremental -L dependency=C:\Users\Pierre\rust\testmqtt\target\debug\deps --extern mosquitto_client=C:\Users\Pierre\rust\testmqtt\target\debug\deps\libmosquitto_client-23967bfdaa3a5433.rlib` (exit code: 1)
It is possible to do that, isn't ?
Regards,
Pierre

how to import jetty or gretty into my gradle script

I am trying out gradle example "todo-webapp-jetty" from the book Gradle In Action. This can be found here. After several searches I came to know that jetty isn't supported anymore. Instead we need to use the gretty plugin(preferably the one that provided by org.gretty). But still no luck. My build script is same as the example's, just adjusted to use the gretty plugin.
Using the plugins block, this works fine , but only until I execute the jettyRun task. After executing the jettyRun task, the console is stuck at 87% :
plugins{
id 'java'
id 'war'
id 'org.gretty' version '2.2.0'
}
............
t<===========--> 87% EXECUTING [13s]a:509)
> :jettyRun=--> 87% EXECUTING [12s]artifacts.configurations.DefaultConfiguration.access$1800> :jettyRun=--> 87% EXECUTING [12s]
> :jettyRunorg.gradle.api.internal.artifacts.configurations.DefaultConfiguration$Configurati<===========--> 87% EXECUTING [12s]ts(DefaultConfiguration.java:1037)
> :jettyRunorg.gradle.api.internal.artifacts.configurations.DefaultConfiguration$Configurati<===========--> 87% EXECUTING [12s]nfiguration.java:1025)
> :jettyRun 81 more
<===========--> 87% EXECUTING [12s]
> :jettyRun
> IDLE
EDIT 1 START : Posting the complete stacktrace
D:\Practice\Gradle\GradleInAction\todo-webapp-jetty>gradle jettyRun -is
Initialized native services in: C:\Users\am064763\.gradle\native
The client will now receive all logging from the daemon (pid: 48064). The daemon log file: C:\Users\am064763\.gradle\daemon\4.10.2\daemon-48064.out.log
Starting 2nd build in daemon [uptime: 10.343 secs, performance: 97%, GC rate: 0.50/s, tenured heap usage: 2% of 716.2 MB]
Using 8 worker leases.
Starting Build
another.gradle -->> This is executed during the initialization phase ---- timestamp # 2018-11-16T13:30:45
init.gradle -->> This is executed during the initialization phase ---- timestamp # 2018-11-16T13:30:45
zingAnother.gradle -->> This is executed during the initialization phase ---- timestamp # 2018-11-16T13:30:45
Settings evaluated using settings file 'D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\settings.gradle'.
Projects loaded. Root project using build file 'D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\build.gradle'.
Included projects: [root project 'todo-webapp-jetty']
> Configure project :
Evaluating root project 'todo-webapp-jetty' using build file 'D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\build.gradle'.
All projects evaluated.
Selected primary task 'jettyRun' from project :
Tasks to be executed: [task ':prepareInplaceWebAppFolder', task ':createInplaceWebAppFolder', task ':compileJava', task ':processResources', task ':classes', task ':prepareInplaceWebAppClasses', task ':prepareInplaceWebApp', task ':jettyRun']
:prepareInplaceWebAppFolder (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :prepareInplaceWebAppFolder UP-TO-DATE
Skipping task ':prepareInplaceWebAppFolder' as it is up-to-date.
:prepareInplaceWebAppFolder (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.111 secs.
:createInplaceWebAppFolder (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :createInplaceWebAppFolder UP-TO-DATE
Skipping task ':createInplaceWebAppFolder' as it is up-to-date.
:createInplaceWebAppFolder (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.001 secs.
:compileJava (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :compileJava UP-TO-DATE
Skipping task ':compileJava' as it is up-to-date.
:compileJava (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.048 secs.
:processResources (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :processResources NO-SOURCE
file or directory 'D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\src\main\resources', not found
Skipping task ':processResources' as it has no source files and no previous output files.
:processResources (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.001 secs.
:classes (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :classes UP-TO-DATE
Skipping task ':classes' as it has no actions.
:classes (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.0 secs.
:prepareInplaceWebAppClasses (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :prepareInplaceWebAppClasses UP-TO-DATE
Skipping task ':prepareInplaceWebAppClasses' as it has no actions.
:prepareInplaceWebAppClasses (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.0 secs.
:prepareInplaceWebApp (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :prepareInplaceWebApp UP-TO-DATE
Skipping task ':prepareInplaceWebApp' as it has no actions.
:prepareInplaceWebApp (Thread[Task worker for ':' Thread 5,5,main]) completed. Took 0.0 secs.
:jettyRun (Thread[Task worker for ':' Thread 5,5,main]) started.
> Task :jettyRun
Task ':jettyRun' is not up-to-date because:
Task.upToDateWhen is false.
scanDir: D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\src\main\webapp
scanDir: D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\src\main\resources
scanDir: D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\src\main\java
scanDir: D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\build\classes\java\main
scanDir: D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\build\resources\main
scanDir: C:\Users\am064763\.gradle\caches\modules-2\files-2.1\javax.servlet\javax.servlet-api\3.1.0\3cd63d075497751784b2fa84be59432f4905bf7c\javax.servlet-api-3.1.0.jar
scanDir: C:\Users\am064763\.gradle\caches\modules-2\files-2.1\javax.websocket\javax.websocket-api\1.0\fc843b649d4a1dcb0497669d262befa3918c7ba8\javax.websocket-api-1.0.jar
scanDir: C:\Users\am064763\.gradle\caches\modules-2\files-2.1\javax.servlet\servlet-api\2.5\5959582d97d8b61f4d154ca9e495aafd16726e34\servlet-api-2.5.jar
scanDir: C:\Users\am064763\.gradle\caches\modules-2\files-2.1\javax.servlet\jstl\1.1.2\3375e43c620df4f1114959400ff9bb90d12a2feb\jstl-1.1.2.jar
fastReloadMap={:=[org.akhikhl.gretty.FileReloadSpec(D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\src\main\webapp, null, null)]}
Enabling hot deployment with interval of 1 second(s)
Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty9/2.2.0/gretty-runner-jetty9-2.2.0.pom]
Resource missing. [HTTP HEAD: https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty9/2.2.0/gretty-runner-jetty9-2.2.0.jar]
Stopping scanner
Exception in thread "Thread-52" org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':grettyRunnerJetty9'.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:1054)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:123)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:1028)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:444) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:59)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:228)
at org.gradle.internal.metaobject.BeanDynamicObject.tryGetProperty(BeanDynamicObject.java:171)
at org.gradle.internal.metaobject.CompositeDynamicObject.tryGetProperty(CompositeDynamicObject.java:55)
at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:59)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getProperty(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:299)
at org.akhikhl.gretty.DefaultLauncher.getRunnerClassPath(DefaultLauncher.groovy:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:479)
at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:191)
at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:78)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:398)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:338)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:177)
at org.akhikhl.gretty.DefaultLauncher$_javaExec_closure7.doCall(DefaultLauncher.groovy:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:434)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:155)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106)
at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:167)
at org.gradle.api.internal.file.DefaultFileOperations.javaexec(DefaultFileOperations.java:224)
at org.gradle.api.internal.project.DefaultProject.javaexec(DefaultProject.java:1102)
at org.gradle.api.internal.project.DefaultProject.javaexec(DefaultProject.java:1097)
at org.gradle.api.Project$javaexec$6.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at org.akhikhl.gretty.DefaultLauncher.javaExec(DefaultLauncher.groovy:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:169)
at org.akhikhl.gretty.LauncherBase$_launchThread_closure4.doCall(LauncherBase.groovy:256)
at org.akhikhl.gretty.LauncherBase$_launchThread_closure4.doCall(LauncherBase.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.run(Closure.java:499)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.gretty:gretty-runner-jetty9:2.2.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty9/2.2.0/gretty-runner-jetty9-2.2.0.pom
- https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty9/2.2.0/gretty-runner-jetty9-2.2.0.jar
Required by:
project :
at org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult.notFound(DefaultBuildableComponentResolveResult.java:49)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:108)
at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:63)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$ComponentMetaDataResolverChain.resolve(ComponentResolversChain.java:94)
at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:62)
<===========--> 87% EXECUTING [37s]artifacts.ivyservice.resolveengine.graph.builder.ComponentState.resolve(ComponentState.java:208)
> :jettyRunorg.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState.resolve(ComponentState.java:196)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState.getMetadata(ComponentState.java:152)
> :jettyRun=--> 87% EXECUTING [34s]artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:156)
<===========--> 87% EXECUTING [34s]artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:112)
> :jettyRunorg.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:315)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:202)
> :jettyRun=--> 87% EXECUTING [33s]artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:155)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:126)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:123)
> :jettyRun=--> 87% EXECUTING [33s]artifacts.ivyservice.DefaultConfigurationResolver.resolveGraph(DefaultConfigurationResolver.java:167)
<===========--> 87% EXECUTING [33s]artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveGraph(ShortCircuitEmptyConfigurationResolver.java:89)
> :jettyRun=--> 87% EXECUTING [33s]artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveGraph(ErrorHandlingConfigurationResolver.java:73)
> :jettyRun=--> 87% EXECUTING [33s]artifacts.configurations.DefaultConfiguration$5.run(DefaultConfiguration.java:533)
> :jettyRun=--> 87% EXECUTING [33s]ations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
> :jettyRunorg.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
<===========--> 87% EXECUTING [32s]ations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
> :jettyRunorg.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfig> :jettyRun=--> 87% EXECUTING [32s]
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:509)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1800(DefaultConfiguration.java:123)
> :jettyRun=--> 87% EXECUTING [32s]artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getSelectedArtifacts(DefaultConfiguration.java:1037)
> :jettyRunorg.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:1025)
... 81 more
> :jettyRun=--> 87% EXECUTING [10s]
> :jettyRun
> IDLE
EDIT 1 END
But without the plugins block this, doesn't work and whenever I run the build I get below error message :
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'org.gretty'
********
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Practice\Gradle\GradleInAction\todo-webapp-jetty\build.gradle' line: 3
* What went wrong:
A problem occurred evaluating root project 'todo-webapp-jetty'.
> Plugin with id 'org.gretty' not found.
EDIT 2 START My build.gradle :
plugins{
id 'java'
id 'war'
id 'org.gretty' version '2.2.0'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
runtime 'javax.servlet:jstl:1.1.2'
}
EDIT 2 END
Any guidance is greatly appreciated.
It is the "normal" behavior of Gradle when execute tasks that are launching and running an application (like jettyRun or bootRun) : you will see the <===---> XY% EXECUTING [...] message while the application is executing..
For example with Spring Boot bootRun task you would have:
$ ./gradlew bootRun
> Task :bootRun
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.0.6.RELEASE)
<=========----> 75% EXECUTING [1m 58s]
> :bootRun
You should configuring logging in your application, to make some log traces available in STDOUT , you would normally see that the application is properly started.
EDIT1
From your stacktrace:
Enabling hot deployment with interval of 1 second(s)
Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty9/2.2.0/gretty-runner-jetty9-2.2.0.pom]
Resource missing. [HTTP HEAD: https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty9/2.2.0/gretty-runner-jetty9-2.2.0.jar]
Stopping scanner
Exception in thread "Thread-52" org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':grettyRunnerJetty9'.
==> you need to add jcenter() in your repositories block , because gretty-runner-jetty9-2.2.0.jar required dependency is not available in maven central repository.
repositories {
jcenter()
// your other repositories ...
}

No such file or directory when adding arguments to Gradle exec task

I am making task which runs bash script
task wsUpload(type: Exec) {
commandLine '../scripts/ws_upload.sh ' + rootProject.ext.VERSION_CODE
}
however it returns
Caused by: java.io.IOException: Cannot run program "../scripts/ws_upload.sh 30" .... No such file or directory
if i ran same command without arguments
task wsUpload(type: Exec) {
commandLine '../scripts/ws_upload.sh'
}
then command is executed. What am i doing wrong?
Add args like this
task wsUpload(type: Exec) {
commandLine '../scripts/ws_upload.sh'
args = ["args"]
}

gradlew build is been failed,only for grunt default it was getting failed

I am trying to do gradlew build in my local machine:
I am getting an error message:
Running "sprite:all" (sprite) task
Fatal error: Unsupported file type: .jpg
:build FAILED
FAILURE: Build failed with an exception.
Where:
Build file 'D:\DL\build.gradle' line: 52
What went wrong:
Execution failed for task ':grunt_default'.
Process 'command 'cmd'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output
BUILD FAILED
Total time: 21.972 secs
using code in Gruntfile.js:
sprite:{
all: {
src: baseDir + 'web/sass/sprites/*',
destImg: baseDir + 'web/webroot/_ui/desktop/theme/images/sprites.png',
destCSS: baseDir + 'web/sass/sprites.scss',
'cssVarMap': function (sprite) {
sprite.name = 'sprite-' + sprite.name;
},
'padding': 2,
'algorithm': 'alt-diagonal',
'imgPath': '../images/sprites.png',
}
},
Tried to setup imagemagick still it wasn't working

Resources