Skip to content

Commit

Permalink
Merge pull request #1864 from arunvenmany-ibm/variable_resolution_fix
Browse files Browse the repository at this point in the history
changes to support liberty predefined variable processing
  • Loading branch information
arunvenmany-ibm authored Feb 18, 2025
2 parents fddf86e + f472ab8 commit a7ebf16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2020, 2023.
* (C) Copyright IBM Corporation 2020, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -238,7 +238,7 @@ else if (util == null && !noFeaturesSection) {
Set<String> dependencyFeatures = getDependencyFeatures();
Set<String> serverFeatures = new HashSet<String>();
Set<String> serverPlatforms = new HashSet<String>();
FeaturesPlatforms getServerResult = serverDirectory.exists() ? util.getServerFeatures(serverDirectory, LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(getLog()), installDirectory, userDirectory, serverDirectory)) : null;
FeaturesPlatforms getServerResult = serverDirectory.exists() ? util.getServerFeatures(serverDirectory, LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(getLog()), installDirectory, userDirectory, serverDirectory, new File(outputDirectory, serverName))) : null;
if (getServerResult != null) {
serverFeatures = getServerResult.getFeatures();
serverPlatforms = getServerResult.getPlatforms();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import io.openliberty.tools.common.plugins.util.ServerFeatureUtil;
import io.openliberty.tools.common.plugins.util.ServerFeatureUtil.FeaturesPlatforms;
import io.openliberty.tools.common.plugins.util.ServerStatusUtil;
import io.openliberty.tools.maven.BasicSupport;
import io.openliberty.tools.maven.applications.DeployMojoSupport;
import io.openliberty.tools.maven.applications.LooseWarApplication;
import io.openliberty.tools.maven.utils.DevHelper;
Expand Down Expand Up @@ -349,11 +348,11 @@ private class DevMojoUtil extends DevUtil {
List<MavenProject> upstreamMavenProjects;

public DevMojoUtil(File installDir, File userDir, File serverDirectory, File sourceDirectory,
File testSourceDirectory, File configDirectory, File projectDirectory, File multiModuleProjectDirectory,
List<File> resourceDirs, JavaCompilerOptions compilerOptions, String mavenCacheLocation,
List<ProjectModule> upstreamProjects, List<MavenProject> upstreamMavenProjects, boolean recompileDeps,
File pom, Map<String, List<String>> parentPoms, boolean generateFeatures, boolean skipInstallFeature,
Set<String> compileArtifactPaths, Set<String> testArtifactPaths, List<Path> webResourceDirs) throws IOException, PluginExecutionException {
File testSourceDirectory, File configDirectory, File projectDirectory, File multiModuleProjectDirectory,
List<File> resourceDirs, JavaCompilerOptions compilerOptions, String mavenCacheLocation,
List<ProjectModule> upstreamProjects, List<MavenProject> upstreamMavenProjects, boolean recompileDeps,
File pom, Map<String, List<String>> parentPoms, boolean generateFeatures, boolean skipInstallFeature,
Set<String> compileArtifactPaths, Set<String> testArtifactPaths, List<Path> webResourceDirs, File serverOutputDirectory) throws IOException, PluginExecutionException {
super(new File(project.getBuild().getDirectory()), serverDirectory, sourceDirectory, testSourceDirectory,
configDirectory, projectDirectory, multiModuleProjectDirectory, resourceDirs, changeOnDemandTestsAction, hotTests, skipTests,
skipUTs, skipITs, skipInstallFeature, project.getArtifactId(), serverStartTimeout, verifyTimeout, verifyTimeout,
Expand All @@ -363,7 +362,7 @@ public DevMojoUtil(File installDir, File userDir, File serverDirectory, File sou
pom, parentPoms, generateFeatures, compileArtifactPaths, testArtifactPaths, webResourceDirs, compileMojoError);

this.libertyDirPropertyFiles = LibertyPropFilesUtility.getLibertyDirectoryPropertyFiles(new CommonLogger(getLog()), installDir, userDir,
serverDirectory);
serverDirectory, serverOutputDirectory);
ServerFeatureUtil servUtil = getServerFeatureUtil(true, libertyDirPropertyFiles);
FeaturesPlatforms fp = servUtil.getServerFeatures(serverDirectory, libertyDirPropertyFiles);
if (fp != null) {
Expand Down Expand Up @@ -1640,7 +1639,7 @@ private void doDevMode() throws MojoExecutionException {
util = new DevMojoUtil(installDirectory, userDirectory, serverDirectory, sourceDirectory, testSourceDirectory,
configDirectory, project.getBasedir(), multiModuleProjectDirectory, resourceDirs, compilerOptions,
settings.getLocalRepository(), upstreamProjects, upstreamMavenProjects, recompileDeps, pom, parentPoms,
generateFeatures, skipInstallFeature, compileArtifactPaths, testArtifactPaths, webResourceDirs);
generateFeatures, skipInstallFeature, compileArtifactPaths, testArtifactPaths, webResourceDirs, new File(super.outputDirectory,serverName));
} catch (IOException | PluginExecutionException |DependencyResolutionRequiredException e) {
throw new MojoExecutionException("Error initializing dev mode.", e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2017, 2024.
* (C) Copyright IBM Corporation 2017, 2025.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -386,7 +386,7 @@ protected Set<String> getAppConfigLocationsFromSourceServerXml() {
protected ServerConfigDocument getServerConfigDocument(CommonLoggerI log, File serverXML) throws IOException, MojoExecutionException {
if (scd == null || !scd.getOriginalServerXMLFile().getCanonicalPath().equals(serverXML.getCanonicalPath())) {
try {
scd = new ServerConfigDocument(log, serverXML, installDirectory,userDirectory,serverDirectory);
scd = new ServerConfigDocument(log, serverXML, installDirectory,userDirectory,serverDirectory, new File(outputDirectory, serverName));
} catch (PluginExecutionException e) {
throw new MojoExecutionException(e.getMessage());
}
Expand Down

0 comments on commit a7ebf16

Please sign in to comment.