private static ProcessorConfig extractProcesssorConfiguration(ProcessorConfigurationExtractor extractor, String profile, File resourceDir) throws IOException { Profile profileFound = findProfile(profile, resourceDir); return extractor.extract(profileFound); }
/** * Determine the spring-boot devtools version for the current project */ public static Optional<String> getSpringBootDevToolsVersion(MavenProject mavenProject) { return getSpringBootVersion(mavenProject); }
private String prepareHostForRoute(String routeDomainPostfix, String name) { String ret = FileUtil.stripPostfix(name,"-service"); ret = FileUtil.stripPostfix(ret,"."); ret += "."; ret += FileUtil.stripPrefix(routeDomainPostfix, "."); return ret; }
public static File save(File file, Object data, ResourceFileType type) throws IOException { File output = type.addExtensionIfMissing(file); ensureDir(file); getObjectMapper(type).writeValue(output, data); return output; }
public static int runCommand(final Logger log, File command, List<String> args, boolean withShutdownHook) throws IOException { return runAsyncCommand(log, command, args, withShutdownHook, true).await(); }
/** * Find a free (on localhost) random port in the range [49152, 65535] after 100 attempts. * * @return a random port where a server socket can be bound to */ public static int getFreeRandomPort() { // 100 attempts should be enough return getFreeRandomPort(49152, 65535, 100); }
public ResourceVersioning withCoreVersion(String coreVersion) { ResourceVersioning c = copy(); c.setCoreVersion(coreVersion); return c; }
public ResourceVersioning withExtensionsVersion(String extensionsVersion) { ResourceVersioning c = copy(); c.setExtensionsVersion(extensionsVersion); return c; }
public ResourceVersioning withAppsVersion(String appsVersion) { ResourceVersioning c = copy(); c.setAppsVersion(appsVersion); return c; }
public ResourceVersioning withJobVersion(String jobVersion) { ResourceVersioning c = copy(); c.setJobVersion(jobVersion); return c; }
public PluginServiceFactory(C context, ClassLoader ... loaders) { this.context = context; for (ClassLoader loader : loaders) { addAdditionalClassLoader(loader); } }
private <T> void readServiceDefinitions(Map<ServiceEntry, T> extractorMap, String defPath) { try { for (String url : ClassUtil.getResources(defPath, additionalClassLoaders)) { readServiceDefinitionFromUrl(extractorMap, url); } } catch (IOException e) { throw new IllegalStateException("Cannot load service from " + defPath + ": " + e, e); } }
@Override public void visit(PodSpecBuilder builder) { KubernetesResourceUtil.mergePodSpec(builder, podSpec, name); } });
/** * Returns true if maven is running with any of the given goals */ public boolean runningWithGoal(String... goals) throws MojoExecutionException { for (String goal : goals) { if (goalFinder.runningWithGoal(project, session, goal)) { return true; } } return false; }
/** * Returns true if the maven project has a dependency with the given groupId and artifactId (if not null) */ public static boolean hasDependency(MavenProject project, String groupId, String artifactId) { return getDependencyVersion(project, groupId, artifactId) != null; }
public T get() { T result = instance; if (result == null) { synchronized (this) { result = instance; if (result == null) { instance = result = build(); } } } return result; }
protected ResourceVersioning copy() { return new ResourceVersioning(coreVersion, extensionsVersion, appsVersion, jobVersion); } }
@Override public void visit(PodSpecBuilder builder) { KubernetesResourceUtil.mergePodSpec(builder, podSpec, name); } });