public class MavenUtil extends Object
Constructor and Description |
---|
MavenUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
createArchive(File sourceDir,
File destinationFile,
org.codehaus.plexus.archiver.jar.JarArchiver archiver) |
static void |
createArchive(File sourceDir,
File destinationFile,
org.codehaus.plexus.archiver.tar.TarArchiver archiver) |
static void |
createArchive(File sourceDir,
File destinationFile,
org.codehaus.plexus.archiver.zip.ZipArchiver archiver) |
static String |
createDefaultResourceName(org.apache.maven.project.MavenProject project,
String... suffixes) |
static File |
extractKubernetesJson(File f,
Path dir) |
static URLClassLoader |
getCompileClassLoader(org.apache.maven.project.MavenProject project) |
static String |
getDependencyVersion(org.apache.maven.project.MavenProject project,
String groupId,
String artifactId)
Returns the version associated to the dependency dependency with the given groupId and artifactId (if present)
|
static org.apache.maven.model.Plugin |
getPlugin(org.apache.maven.project.MavenProject project,
String groupId,
String artifactId)
Returns the plugin with the given groupId (if present) and artifactId (if present).
|
static org.apache.maven.model.Plugin |
getPluginOfAnyGroupId(org.apache.maven.project.MavenProject project,
String pluginArtifact) |
static org.apache.maven.project.MavenProject |
getRootProject(org.apache.maven.project.MavenProject project)
Returns the root maven project or null if there is no maven project
|
static URLClassLoader |
getTestClassLoader(org.apache.maven.project.MavenProject project) |
static String |
getVersion(String groupId,
String artifactId)
Returns the version from the list of pre-configured versions of common groupId/artifact pairs
|
static boolean |
hasAllClasses(org.apache.maven.project.MavenProject project,
String... classNames)
Returns true if all the given class names could be found on the given class loader
|
static boolean |
hasClass(org.apache.maven.project.MavenProject project,
String... classNames)
Returns true if any of the given class names could be found on the given class loader
|
static boolean |
hasDependency(org.apache.maven.project.MavenProject project,
String groupId,
String artifactId)
Returns true if the maven project has a dependency with the given groupId and artifactId (if not null)
|
static boolean |
hasDependencyOnAnyArtifactOfGroup(org.apache.maven.project.MavenProject project,
String groupId)
Returns true if the maven project has a dependency with the given groupId
|
static boolean |
hasKubernetesJson(File f) |
static boolean |
hasPlugin(org.apache.maven.project.MavenProject project,
String plugin) |
static boolean |
hasPluginOfAnyGroupId(org.apache.maven.project.MavenProject project,
String pluginArtifact) |
static boolean |
isKubernetesJsonArtifact(String classifier,
String type) |
public static boolean isKubernetesJsonArtifact(String classifier, String type)
public static boolean hasKubernetesJson(File f) throws IOException
IOException
public static File extractKubernetesJson(File f, Path dir) throws IOException
IOException
public static URLClassLoader getCompileClassLoader(org.apache.maven.project.MavenProject project)
public static URLClassLoader getTestClassLoader(org.apache.maven.project.MavenProject project)
public static String createDefaultResourceName(org.apache.maven.project.MavenProject project, String... suffixes)
public static boolean hasDependencyOnAnyArtifactOfGroup(org.apache.maven.project.MavenProject project, String groupId)
public static boolean hasDependency(org.apache.maven.project.MavenProject project, String groupId, String artifactId)
public static String getDependencyVersion(org.apache.maven.project.MavenProject project, String groupId, String artifactId)
public static boolean hasPlugin(org.apache.maven.project.MavenProject project, String plugin)
public static boolean hasPluginOfAnyGroupId(org.apache.maven.project.MavenProject project, String pluginArtifact)
public static org.apache.maven.model.Plugin getPluginOfAnyGroupId(org.apache.maven.project.MavenProject project, String pluginArtifact)
public static org.apache.maven.model.Plugin getPlugin(org.apache.maven.project.MavenProject project, String groupId, String artifactId)
public static boolean hasClass(org.apache.maven.project.MavenProject project, String... classNames)
public static boolean hasAllClasses(org.apache.maven.project.MavenProject project, String... classNames)
public static org.apache.maven.project.MavenProject getRootProject(org.apache.maven.project.MavenProject project)
public static void createArchive(File sourceDir, File destinationFile, org.codehaus.plexus.archiver.tar.TarArchiver archiver) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public static void createArchive(File sourceDir, File destinationFile, org.codehaus.plexus.archiver.zip.ZipArchiver archiver) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public static void createArchive(File sourceDir, File destinationFile, org.codehaus.plexus.archiver.jar.JarArchiver archiver) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public static String getVersion(String groupId, String artifactId) throws IOException
IOException
Copyright © 2018. All rights reserved.