Skip to content

Commit a0c9df8

Browse files
committed
#567: MlcpTask no longer prints COPY arguments
1 parent ad9f9ad commit a0c9df8

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

examples/mlcp-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ configurations {
2121
}
2222

2323
dependencies {
24-
mlcp "com.marklogic:mlcp:9.0.7"
24+
mlcp "com.marklogic:mlcp:10.0.4"
2525

2626
/**
2727
* mlcp uses Log4j for logging, and if Log4j can't find a configuration file, it will complain and you'll

src/main/groovy/com/marklogic/gradle/task/MlcpTask.groovy

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,18 @@ class MlcpTask extends JavaExec {
100100
// Include any args that a user has configured via the args parameter of the Gradle task
101101
newArgs.addAll(getArgs())
102102

103-
println "mlcp arguments, excluding password: " + newArgs
103+
// Build args to print, excluding the two known COPY arguments that will reveal passwords
104+
List<String> safeArgsToPrint = new ArrayList<>()
105+
for (int i = 0; i < newArgs.size(); i++) {
106+
String arg = newArgs.get(i)
107+
if ("-password".equals(arg) || "-input_password".equals(arg) || "-output_password".equals(arg)) {
108+
// Skip the next argument too
109+
i++
110+
} else {
111+
safeArgsToPrint.add(arg)
112+
}
113+
}
114+
println "mlcp arguments, excluding known password arguments: " + safeArgsToPrint
104115

105116
if (!isCopy) {
106117
newArgs.add("-password")

0 commit comments

Comments
 (0)