Source:
<code>private File findDockerFileFile(Logger log) { if (dockerFile != null) { if (EnvUtil.isWindows() && !EnvUtil.isValidWindowsFileName(dockerFile)) { throw new IllegalArgumentException(String.format("Invalid Windows file name %s for <dockerFile>", dockerFile)); } File dFile = new File(dockerFile); if (dockerFileDir == null && contextDir == null) { return dFile; } else { if(contextDir != null) { if(dockerFileDir != null) { <START> log.warn("using contextDir as it has more precedence for Dockerfile"); <END> } if (dFile.isAbsolute()) { try { Files.copy(dFile.toPath(), Paths.get(contextDir)); } catch (IOException exception) { log.warn("Error during copying Dockerfile to contextDir: ", exception.getMessage()); } return new File(contextDir, "Dockerfile"); } return new File(contextDir, dockerFile); } if (dockerFileDir != null) { if (dFile.isAbsolute()) { throw new IllegalArgumentException("<dockerFile> can not be absolute path if <dockerFileDir> also set."); } log.warn("dockerFileDir parameter is deprecated, please migrate to contextDir"); return new File(dockerFileDir, dockerFile); } } } if (contextDir != null) { if(dockerFileDir != null) { log.warn("using contextDir as it has more precedence for Dockerfile"); } return new File(contextDir, "Dockerfile"); } if (dockerFileDir != null) { return new File(dockerFileDir, "Dockerfile"); } if (dockerArchive == null) { String deprecatedDockerFileDir = getAssemblyConfiguration() != null ? getAssemblyConfiguration().getDockerFileDir() : null; if (deprecatedDockerFileDir != null) { log.warn("<dockerFileDir> in the <assembly> section of a <build> configuration is deprecated"); log.warn("Please use <dockerFileDir> or <dockerFile> directly within the <build> configuration instead"); return new File(deprecatedDockerFileDir,"Dockerfile"); } } return null; }</code><technical_language>Precedence ? Suggestion: "Both contextDir (%s) deprecated dockerFileDir (%s) configured. contextDir." (with inserting concrete values)</technical_language>

Target:
private File findDockerFileFile(Logger log) { if(dockerFileDir != null && contextDir != null) { log.warn("Both contextDir (%s) and deprecated dockerFileDir (%s) are configured. Using contextDir.", contextDir, dockerFileDir); } if (dockerFile != null) { if (EnvUtil.isWindows() && !EnvUtil.isValidWindowsFileName(dockerFile)) { throw new IllegalArgumentException(String.format("Invalid Windows file name %s for <dockerFile>", dockerFile)); } File dFile = new File(dockerFile); if (dockerFileDir == null && contextDir == null) { return dFile; } else { if(contextDir != null) { if (dFile.isAbsolute()) { return dFile; } return new File(contextDir, dockerFile); } if (dockerFileDir != null) { if (dFile.isAbsolute()) { throw new IllegalArgumentException("<dockerFile> can not be absolute path if <dockerFileDir> also set."); } log.warn("dockerFileDir parameter is deprecated, please migrate to contextDir"); return new File(dockerFileDir, dockerFile); } } } if (contextDir != null) { return new File(contextDir, "Dockerfile"); } if (dockerFileDir != null) { return new File(dockerFileDir, "Dockerfile"); } if (dockerArchive == null) { String deprecatedDockerFileDir = getAssemblyConfiguration() != null ? getAssemblyConfiguration().getDockerFileDir() : null; if (deprecatedDockerFileDir != null) { log.warn("<dockerFileDir> in the <assembly> section of a <build> configuration is deprecated"); log.warn("Please use <dockerFileDir> or <dockerFile> directly within the <build> configuration instead"); return new File(deprecatedDockerFileDir,"Dockerfile"); } } return null; }