Skip to content

Commit

Permalink
Fix for loose app config validation
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed Apr 3, 2023
1 parent 10198e8 commit f2409d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f2409d5

Please sign in to comment.