public class JKubeProjectUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_RESOURCE_NAME_LENGTH |
| Modifier and Type | Method and Description |
|---|---|
static String |
createDefaultResourceName(String artifactId,
String... suffixes) |
static String |
getAnyDependencyVersionWithGroupId(JavaProject jkubeProject,
String groupId) |
static URLClassLoader |
getClassLoader(JavaProject jKubeProject) |
static Dependency |
getDependency(JavaProject jkubeProject,
String groupId,
String artifactId) |
static File |
getFinalOutputArtifact(JavaProject jkubeProject)
Returns the output artifact for the Project.
|
static Plugin |
getPlugin(JavaProject jkubeProject,
String artifactId) |
static Plugin |
getPlugin(JavaProject javaProject,
String groupId,
String artifactId) |
static Properties |
getPropertiesWithSystemOverrides(JavaProject project) |
static String |
getProperty(String key,
JavaProject project) |
static boolean |
hasDependency(JavaProject jkubeProject,
String groupId,
String artifactId) |
static boolean |
hasDependencyWithGroupId(JavaProject project,
String groupId) |
static boolean |
hasPlugin(JavaProject jkubeProject,
String groupId,
String artifactId) |
static boolean |
hasPluginOfAnyArtifactId(JavaProject jkubeProject,
String artifactId) |
static boolean |
hasResource(JavaProject project,
String... paths)
Checks if the resources specified in the provided paths exist in the project.
|
static <T> Optional<T> |
iterateOverListWithCondition(List<T> dependencyList,
Predicate<? super T> condition) |
public static final int MAX_RESOURCE_NAME_LENGTH
public static <T> Optional<T> iterateOverListWithCondition(List<T> dependencyList, Predicate<? super T> condition)
public static String getAnyDependencyVersionWithGroupId(JavaProject jkubeProject, String groupId)
public static Plugin getPlugin(JavaProject javaProject, String groupId, String artifactId)
public static Plugin getPlugin(JavaProject jkubeProject, String artifactId)
public static boolean hasPlugin(JavaProject jkubeProject, String groupId, String artifactId)
public static boolean hasPluginOfAnyArtifactId(JavaProject jkubeProject, String artifactId)
public static boolean hasDependency(JavaProject jkubeProject, String groupId, String artifactId)
public static boolean hasDependencyWithGroupId(JavaProject project, String groupId)
public static Dependency getDependency(JavaProject jkubeProject, String groupId, String artifactId)
public static boolean hasResource(JavaProject project, String... paths) throws IOException
project - where the resources may existpaths - within the project where the resources existIOException - if there's a problem reading the resourcepublic static Properties getPropertiesWithSystemOverrides(JavaProject project)
public static File getFinalOutputArtifact(JavaProject jkubeProject)
This method infers the Project's artifact from the provided project build directory, GAV coordinates, packaging, and configured build name.
If the inferred artifact file exists it is returned.
If the inferred artifact file doesn't exist, but an existent artifact file is provided in the configuration, it is returned instead.
In case no artifacts are found or configured, this method returns null.
TODO: https://github.com/eclipse/jkube/issues/817
This method prioritizes artifact inference instead of configuration. This is done to handle case of maven
where value of artifact varies depending upon the maven phase in which goal was executed.
jkubeProject - project for which to retrieve the output artifact.public static String createDefaultResourceName(String artifactId, String... suffixes)
public static URLClassLoader getClassLoader(JavaProject jKubeProject)
public static String getProperty(String key, JavaProject project)
Copyright © 2021. All rights reserved.