在MarkLogic的ml gradle中完全禁用REST端点创建

在MarkLogic的ml gradle中完全禁用REST端点创建,marklogic,ml-gradle,Marklogic,Ml Gradle,我一直在从MarkLogic实例构建配置文件,以便通过ml gradle进行部署。我想在8003完全禁用REST端点。我使用的是ml gradle版本2.7.0。我能够使用gradle mlExportResources收集大部分配置 在我的gradle.properties中,我添加了 mlNoRestServer=true 我的build.gradle文件是 plugins { id "com.marklogic.ml-gradle" version "2.7.0" id "net

我一直在从MarkLogic实例构建配置文件,以便通过ml gradle进行部署。我想在8003完全禁用REST端点。我使用的是ml gradle版本2.7.0。我能够使用gradle mlExportResources收集大部分配置

在我的gradle.properties中,我添加了

mlNoRestServer=true
我的build.gradle文件是

plugins {
  id "com.marklogic.ml-gradle" version "2.7.0"
  id "net.saliman.properties" version "1.4.6"
}
ext {
    mlAppConfig {
        modulesDatabaseName = "my-modules"
        contentDatabaseName = "my-documents"
        createTriggersDatabase = false
    }

    // Here's an example of not creating a REST API server at all - just remove the command
    mlAppDeployer.getCommands().remove(mlAppDeployer.getCommand("DeployRestApiServersCommand"))

}
在到达REST阶段之前,部署看起来是正常的。即使给出了配置,它仍然是指端口8003

13:03:10.226 [INFO] [org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor] Initializing ExecutorService 
13:03:10.227 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Writing REST server configuration
13:03:10.227 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Default document read transform: null
13:03:10.227 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Transform all documents on read: false
13:03:10.228 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Validate query options: true
13:03:10.228 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Validate queries: true
13:03:10.228 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Output debugging: false
13:03:10.228 [INFO] [com.marklogic.client.impl.ServerConfigurationManagerImpl] Writing server configuration
13:03:10.229 [DEBUG] [com.marklogic.client.impl.JerseyServices] Putting config/properties/null
13:03:10.229 [DEBUG] [org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager] Get connection: {}->http://localhost:8003, timeout = 0
13:03:10.230 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] [{}->http://localhost:8003] total kept alive: 0, total issued: 0, total allocated: 0 out of 200
13:03:10.230 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] No free connections [{}->http://localhost:8003][null]
13:03:10.230 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Available capacity: 100 out of 100 [{}->http://localhost:8003][null]
13:03:10.231 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Creating new connection [{}->http://localhost:8003]
13:03:10.232 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to localhost:8003
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection org.apache.http.impl.conn.DefaultClientConnection@9770e0c closed
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection org.apache.http.impl.conn.DefaultClientConnection@9770e0c shut down
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager] Released connection is not reusable.
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Releasing connection [{}->http://localhost:8003][null]
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection org.apache.http.impl.conn.DefaultClientConnection@9770e0c closed
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Notifying no-one, there are no waiting threads
13:03:10.233 [INFO] [com.marklogic.client.impl.DatabaseClientImpl] Releasing connection
13:03:10.233 [DEBUG] [com.marklogic.client.impl.JerseyServices] Releasing connection
13:03:10.233 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
13:03:10.233 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':mlDeployApp'
13:03:10.233 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :mlDeployApp FAILED
13:03:10.234 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :mlDeployApp (Thread[Daemon worker Thread 11,5,main]) completed. Took 3 mins 12.831 secs.
13:03:10.234 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry] Worker root.3 completed (0 in use)
13:03:10.234 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 11,5,main]] finished, busy: 3 mins 12.835 secs, idle: 0.002 secs
13:03:10.235 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
13:03:10.235 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.

不在端口8003上部署REST服务器缺少什么配置?

从2.7.0开始,现在可以在gradle.properties中设置mlNoRestServer=true以禁用REST服务器创建-

上述错误是由以下几行引起的:

13:03:10.228[INFO][com.marklogic.client.impl.ServerConfigurationManagerImpl]写入服务器配置 13:03:10.229[DEBUG][com.marklogic.client.impl.JerseyServices]put config/properties/null


您是否有src/main/ml modules/rest.properties文件?如果是这样,ml gradle会看到它并思考——我需要将它发送到/v1/config/properties以更新RESTAPI服务器,但它不存在,并且会导致错误。我猜这个文件是存在的;尝试删除它并再次运行mlDeploy

这正是我所缺少的。感谢您提供了这个优秀的工具。