Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* (C) Copyright IBM Corporation 2021, 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openliberty.tools.gradle.tasks
import io.openliberty.tools.common.plugins.util.AbstractContainerSupportUtil
import io.openliberty.tools.common.plugins.util.InstallFeatureUtil
import io.openliberty.tools.common.plugins.util.InstallFeatureUtil.ProductProperties
import io.openliberty.tools.common.plugins.util.PluginExecutionException
import io.openliberty.tools.common.plugins.util.PluginScenarioException
import io.openliberty.tools.common.plugins.util.ServerFeatureUtil
import io.openliberty.tools.common.plugins.util.ServerFeatureUtil.FeaturesPlatforms
import io.openliberty.tools.gradle.utils.ArtifactDownloadUtil
import org.gradle.api.artifacts.Configuration
import org.gradle.api.logging.LogLevel
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.options.Option
import java.util.Map.Entry
public class AbstractFeatureTask extends AbstractServerTask {
// DevMode uses this option to provide the location of the
// temporary serverDir it uses after a change to the server.xml
private String serverDirectoryParam;
public boolean installFeaturesFromAnt;
private InstallFeatureUtil util;
private ServerFeatureUtil servUtil;
@Internal
String jsonCoordinate;
@Option(option = 'serverDir', description = '(Optional) Server directory to get the list of features from.')
void setServerDirectoryParam(String serverDir) {
this.serverDirectoryParam = serverDir;
}
private class ServerFeatureTaskUtil extends ServerFeatureUtil {
@Override
public void error(String msg) {
logger.error(msg);
}
@Override
public boolean isDebugEnabled() {
return logger.isDebugEnabled();
}
@Override
public void debug(String msg) {
if (isDebugEnabled()) {
logger.debug(msg);
}
}
@Override
public void error(String msg, Throwable throwable) {
logger.error(msg, e);
}
@Override
public void debug(String msg, Throwable throwable) {
if (isDebugEnabled()) {
logger.debug(msg, (Throwable) e);
}
}
@Override
public void debug(Throwable throwable) {
if (isDebugEnabled()) {
logger.debug("Throwable exception received: " + e.getMessage(), (Throwable) e);
}
}
@Override
public void warn(String msg) {
if (!suppressLogs) {
logger.warn(msg);
} else {
debug(msg);
}
}
@Override
public void info(String msg) {
if (!suppressLogs) {
logger.lifecycle(msg);
} else {
debug(msg);
}
}
}
private class InstallFeatureTaskUtil extends InstallFeatureUtil {
public InstallFeatureTaskUtil(File installDir, File buildDir, String from, String to, Set pluginListedEsas, List propertiesList, String openLibertyVerion, String containerName, List additionalJsons, String verify, Collection