|
46 | 46 | import javax.xml.parsers.ParserConfigurationException; |
47 | 47 | import javax.xml.transform.TransformerException; |
48 | 48 |
|
| 49 | +import io.openliberty.tools.common.plugins.util.InstallFeatureUtil; |
| 50 | +import io.openliberty.tools.common.plugins.util.PluginExecutionException; |
| 51 | +import io.openliberty.tools.common.plugins.util.VersionUtility; |
49 | 52 | import org.apache.commons.lang3.ObjectUtils; |
50 | 53 | import org.apache.maven.artifact.Artifact; |
51 | 54 | import org.apache.maven.artifact.versioning.ComparableVersion; |
@@ -82,6 +85,7 @@ public abstract class StartDebugMojoSupport extends ServerFeatureSupport { |
82 | 85 |
|
83 | 86 | protected final String PLUGIN_VARIABLE_CONFIG_OVERRIDES_XML = "configDropins/overrides/liberty-plugin-variable-config.xml"; |
84 | 87 | protected final String PLUGIN_VARIABLE_CONFIG_DEFAULTS_XML = "configDropins/defaults/liberty-plugin-variable-config.xml"; |
| 88 | + protected static final String MIN_SUPPORTED_VERSION_WITH_ARCHIVE_OPTION_POSIX_FORMAT = "25.0.0.11"; |
85 | 89 |
|
86 | 90 | protected Map<String,String> bootstrapMavenProps = new HashMap<String,String>(); |
87 | 91 | protected Map<String,String> envMavenProps = new HashMap<String,String>(); |
@@ -1103,4 +1107,19 @@ protected void updateArtifactPathToOutputDirectory(MavenProject mavenProject, Ar |
1103 | 1107 |
|
1104 | 1108 | artifactToUpdate.setFile(outputDir.toFile()); |
1105 | 1109 | } |
| 1110 | + |
| 1111 | + /** |
| 1112 | + * |
| 1113 | + * @param serverTask |
| 1114 | + * @throws PluginExecutionException |
| 1115 | + */ |
| 1116 | + protected void checkAndEnablePosixRules(ServerTask serverTask) throws PluginExecutionException { |
| 1117 | + List<InstallFeatureUtil.ProductProperties> propertiesList = InstallFeatureUtil.loadProperties(installDirectory); |
| 1118 | + String openLibertyVersion = InstallFeatureUtil.getOpenLibertyVersion(propertiesList); |
| 1119 | + if (openLibertyVersion != null && |
| 1120 | + VersionUtility.compareArtifactVersion(openLibertyVersion, |
| 1121 | + MIN_SUPPORTED_VERSION_WITH_ARCHIVE_OPTION_POSIX_FORMAT, true) >= 0) { |
| 1122 | + serverTask.setUsePosixRules(true); |
| 1123 | + } |
| 1124 | + } |
1106 | 1125 | } |
0 commit comments