- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的build.gradle文件中有以下任务:
task init_dev {
doLast {
exec {
workingDir '.'
commandLine 'mongo', '--port', '27018', '<', 'init/mongodb-init-dev'
}
}
}
14:52:49: Executing task 'init_dev --info'...
The client will now receive all logging from the daemon (pid: 3919). The daemon log file: /Users/jscherman/.gradle/daemon/4.8.1/daemon-3919.out.log
Starting 42nd build in daemon [uptime: 49 mins 28.148 secs, performance: 99%, no major garbage collections]
Using 8 worker leases.
Starting Build
Settings evaluated using settings file '/Users/jscherman/IdeaProjects/demo/settings.gradle'.
Projects loaded. Root project using build file '/Users/jscherman/IdeaProjects/demo/build.gradle'.
Included projects: [root project 'demo', project ':mock-metrics-generator', project ':demo-be']
> Configure project :
Evaluating root project 'demo' using build file '/Users/jscherman/IdeaProjects/demo/build.gradle'.
Applying dependency management to configuration 'annotationProcessor' in project 'mock-metrics-generator'
Applying dependency management to configuration 'apiElements' in project 'mock-metrics-generator'
Applying dependency management to configuration 'archives' in project 'mock-metrics-generator'
Applying dependency management to configuration 'bootArchives' in project 'mock-metrics-generator'
Applying dependency management to configuration 'compile' in project 'mock-metrics-generator'
Applying dependency management to configuration 'compileClasspath' in project 'mock-metrics-generator'
Applying dependency management to configuration 'compileOnly' in project 'mock-metrics-generator'
Applying dependency management to configuration 'default' in project 'mock-metrics-generator'
Applying dependency management to configuration 'implementation' in project 'mock-metrics-generator'
Applying dependency management to configuration 'runtime' in project 'mock-metrics-generator'
Applying dependency management to configuration 'runtimeClasspath' in project 'mock-metrics-generator'
Applying dependency management to configuration 'runtimeElements' in project 'mock-metrics-generator'
Applying dependency management to configuration 'runtimeOnly' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testCompile' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testCompileClasspath' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testCompileOnly' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testImplementation' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testRuntime' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'mock-metrics-generator'
Applying dependency management to configuration 'testRuntimeOnly' in project 'mock-metrics-generator'
Applying dependency management to configuration 'annotationProcessor' in project 'demo-be'
Applying dependency management to configuration 'apiElements' in project 'demo-be'
Applying dependency management to configuration 'archives' in project 'demo-be'
Applying dependency management to configuration 'bootArchives' in project 'demo-be'
Applying dependency management to configuration 'compile' in project 'demo-be'
Applying dependency management to configuration 'compileClasspath' in project 'demo-be'
Applying dependency management to configuration 'compileOnly' in project 'demo-be'
Applying dependency management to configuration 'default' in project 'demo-be'
Applying dependency management to configuration 'implementation' in project 'demo-be'
Applying dependency management to configuration 'runtime' in project 'demo-be'
Applying dependency management to configuration 'runtimeClasspath' in project 'demo-be'
Applying dependency management to configuration 'runtimeElements' in project 'demo-be'
Applying dependency management to configuration 'runtimeOnly' in project 'demo-be'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'demo-be'
Applying dependency management to configuration 'testCompile' in project 'demo-be'
Applying dependency management to configuration 'testCompileClasspath' in project 'demo-be'
Applying dependency management to configuration 'testCompileOnly' in project 'demo-be'
Applying dependency management to configuration 'testImplementation' in project 'demo-be'
Applying dependency management to configuration 'testRuntime' in project 'demo-be'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'demo-be'
Applying dependency management to configuration 'testRuntimeOnly' in project 'demo-be'
> Configure project :mock-metrics-generator
Evaluating project ':mock-metrics-generator' using build file '/Users/jscherman/IdeaProjects/demo/mock-metrics-generator/build.gradle'.
> Configure project :demo-be
Evaluating project ':demo-be' using build file '/Users/jscherman/IdeaProjects/demo/demo-be/build.gradle'.
All projects evaluated.
Selected primary task 'init_dev' from project :
Tasks to be executed: [task ':init_dev']
:init_dev (Thread[Task worker for ':',5,main]) started.
> Task :init_dev FAILED
Task ':init_dev' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Starting process 'command 'mongo''. Working directory: /Users/jscherman/IdeaProjects/demo Command: mongo --port 27018 < init/mongodb-init-dev
Successfully started process 'command 'mongo''
MongoDB shell version v4.0.3
connecting to: mongodb://127.0.0.1:27018/%3C
Implicit session: session { "id" : UUID("0b3d098a-00e3-4802-bf9f-af7d1f7a6629") }
MongoDB server version: 4.0.3
2019-01-23T14:52:49.741-0300 E QUERY [js] SyntaxError: missing ; before statement @init/mongodb-init-dev:1:4
failed to load: init/mongodb-init-dev
:init_dev (Thread[Task worker for ':',5,main]) completed. Took 0.217 secs.
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/jscherman/IdeaProjects/demo/build.gradle' line: 60
* What went wrong:
Execution failed for task ':init_dev'.
> Process 'command 'mongo'' finished with non-zero exit value 253
* Try:
Run with --stacktrace option to get the stack trace. Run with --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 0s
1 actionable task: 1 executed
Process 'command 'mongo'' finished with non-zero exit value 253
Open File
14:52:49: Task execution finished 'init_dev --info'.
use my_db
db.nodes.drop()
db.nodes.insertMany([
{
"_id":"node-1",
"classifier":{
"lowerThreshold":3000,
"upperThreshold":5000,
"timeUnit":"MILLISECONDS"
}
},
{
"_id":"node-2",
"classifier":{
"lowerThreshold":2,
"upperThreshold":4,
"timeUnit":"SECONDS"
}
},
{
"_id":"node-3",
"classifier":{
"lowerThreshold":3000,
"upperThreshold":5000,
"timeUnit":"MILLISECONDS"
}
},
{
"_id":"node-4",
"classifier":{
"lowerThreshold":1200,
"upperThreshold":4000,
"timeUnit":"MILLISECONDS"
}
},
{
"_id":"node-5",
"classifier":{
"lowerThreshold":2000,
"upperThreshold":5000,
"timeUnit":"MILLISECONDS"
}
}])
madmin’s-MacBook-Pro:demo jscherman$ pwd
/Users/jscherman/IdeaProjects/demo
madmin’s-MacBook-Pro:demo jscherman$ mongo --port 27018 < init/mongodb-init-dev
MongoDB shell version v4.0.3
connecting to: mongodb://127.0.0.1:27018/
Implicit session: session { "id" : UUID("31e9f04c-4a7b-474d-ac18-93f0fb725c86") }
MongoDB server version: 4.0.3
switched to db demo_db
true
{
"acknowledged" : true,
"insertedIds" : [
"node-1",
"node-2",
"node-3",
"node-4",
"node-5"
]
}
bye
最佳答案
use my_db
不是有效的JavaScript语法。从mongodb-init-dev脚本中删除use my_db
,并在build.gradle中添加“my_db”,并如下所示删除“<”:
commandLine 'mongo', '--port', '27018', 'my_db', 'init/mongodb-init-dev'
--info
,即
gradle --info init_dev
以查看其他信息。
关于mongodb - Gradle Task命令失败,但手动工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54333075/
这个问题在这里已经有了答案: Why use async and return await, when you can return Task directly? (8 个答案) 关闭 6 年前。
这个问题在这里已经有了答案: Are the days of passing const std::string & as a parameter over? (13 个答案) 关闭 8 年前。 我
我有一组标记为执行的通用任务。当任务完成时(使用 Task.WaitAny ),我将其添加到 ObservableCollection 中. 但是,问题出在 Task.WaitAny(...)行,上面
经过几个小时的努力,我在我的应用程序中发现了一个错误。我认为下面的 2 个函数具有相同的行为,但事实证明它们没有。 谁能告诉我引擎盖下到底发生了什么,以及为什么它们的行为方式不同? public as
这也与 Python 的导入机制有关,特别是与在函数内使用 import 有关。使用 Python 2.7.9 和 Fabric 1.10.0,创建以下三个文件: fabfile.py: from a
我有一个 Web API Controller (ASP.NET Core 5)。我的一些 API 是异步的,而其中一些不是。我接下来的问题是:使用 public **Task** WebApiMet
我们有类似下面的内容 List uncheckItems = new List(); for (int i = 0; i new Task(async () => await Process
我的代码没问题,但我想知道哪种风格更好,你会怎么看,我正在玩异步方法。 让我建立上下文: Parallel.ForEach(xmlAnimalList, async xml => {
这两种使用 await 的形式在功能上有什么区别吗? string x = await Task.Factory.StartNew(() => GetAnimal("feline")); Task m
我刚刚看到 3 个关于 TPL 使用的例程,它们做同样的工作;这是代码: public static void Main() { Thread.CurrentThread.Name = "Ma
考虑以下代码: public void CacheData() { Task.Run((Action)CacheExternalData); Task.Run(() => CacheE
Task> GetTaskDict() { return Task.FromResult(new Dictionary () ); } 此代码无法编译,因为我们无法在 Task> 到 Tas
我正在使用 ASP.NET 5 RC1 _MyPartial @model MyViewModel @using (Html.BeginForm())
当我尝试在 VS Code 中构建 C 任务时,它显示以下消息: 输出仅显示:The task provider for "C/C++" tasks unexpectedly provided a t
一些背景: 基本上归结为我希望能够在当前线程中“执行”任务。为什么? -我有一个任务创建程序例程,有一次我希望任务在后台任务中立即执行,而其他时候我希望使用 IOmniThreadPool 安排任务。
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我试图将run-sequence添加到我的gulp工作流程中,但是每次尝试执行使用run-sequence的任务时,都会出现此错误: 任务未配置为gulp上的任务。 根据运行序列的来源,这是由以下te
此代码在VS2015中给出了编译时错误 Error CS0266 Cannot implicitly convert type 'System.Threading.Tasks.Task' to 'Sy
我正在尝试通过我的代码通过Google登出: suspend fun signOut(context: Context): Boolean = with(Dispatchers.IO) { t
谁能解释一下这两种说法的区别: Task bTask = backup.BackupCurrentDatabaseAsync() .ContinueWith(_ => CompressArch
我是一名优秀的程序员,十分优秀!