From f2409d55bfc69ca288fb7342243b1856e9c1101e Mon Sep 17 00:00:00 2001 From: Cheryl King Date: Mon, 3 Apr 2023 09:45:28 -0500 Subject: [PATCH] Fix for loose app config validation --- .../openliberty/tools/maven/applications/DeployMojo.java | 7 ++++--- .../tools/maven/applications/DeployMojoSupport.java | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java index a78ab20e4..56cdfcd1c 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojo.java @@ -196,6 +196,7 @@ private void installLooseApplication(MavenProject proj) throws Exception { String application = looseConfigFileName.substring(0, looseConfigFileName.length() - 4); File destDir = new File(serverDirectory, getAppsDirectory()); File looseConfigFile = new File(destDir, looseConfigFileName); + File applicationFullPath = new File(destDir, application); File devcDestDir = new File(new File(project.getBuild().getDirectory(), DevUtil.DEVC_HIDDEN_FOLDER), getAppsDirectory()); File devcLooseConfigFile = new File(devcDestDir, looseConfigFileName); @@ -204,7 +205,7 @@ private void installLooseApplication(MavenProject proj) throws Exception { switch (proj.getPackaging()) { case "war": - validateAppConfig(application, proj.getArtifactId()); + validateAppConfig(applicationFullPath.getCanonicalPath(), application, proj.getArtifactId()); log.info(MessageFormat.format(messages.getString("info.install.app"), looseConfigFileName)); installLooseConfigWar(proj, config, false); installAndVerifyApp(config, looseConfigFile, application); @@ -216,7 +217,7 @@ private void installLooseApplication(MavenProject proj) throws Exception { } break; case "ear": - validateAppConfig(application, proj.getArtifactId()); + validateAppConfig(applicationFullPath.getCanonicalPath(), application, proj.getArtifactId()); log.info(MessageFormat.format(messages.getString("info.install.app"), looseConfigFileName)); installLooseConfigEar(proj, config, false); installAndVerifyApp(config, looseConfigFile, application); @@ -229,7 +230,7 @@ private void installLooseApplication(MavenProject proj) throws Exception { break; case "liberty-assembly": if (mavenWarPluginExists(proj) || new File(proj.getBasedir(), "src/main/webapp").exists()) { - validateAppConfig(application, proj.getArtifactId()); + validateAppConfig(applicationFullPath.getCanonicalPath(), application, proj.getArtifactId()); log.info(MessageFormat.format(messages.getString("info.install.app"), looseConfigFileName)); installLooseConfigWar(proj, config, false); installAndVerifyApp(config, looseConfigFile, application); diff --git a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java index 700dbee4b..135a4272d 100644 --- a/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java +++ b/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/applications/DeployMojoSupport.java @@ -381,10 +381,6 @@ private boolean containsJavaSource(File dir) { return false; } - protected void validateAppConfig(String fileName, String artifactId) throws Exception { - validateAppConfig(null, fileName, artifactId, false); - } - protected void validateAppConfig(String fullyQualifiedFileName, String fileName, String artifactId) throws Exception { validateAppConfig(fullyQualifiedFileName, fileName, artifactId, false); }