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 Properties |
getPropertiesFile(org.apache.maven.project.MavenProject project,
String propertiesFileName)
Returns the given properties file on the project classpath if found or an empty properties object if not
|
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 Properties |
getSpringBootApplicationProperties(org.apache.maven.project.MavenProject project)
Returns the spring boot `application.properties` or an empty properties object if not found
|
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 |
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)
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 |
isKubernetesJsonArtifact(String classifier,
String type) |
public static boolean isKubernetesJsonArtifact(String classifier, String type)
public static boolean hasKubernetesJson(File f) throws IOException
IOExceptionpublic static File extractKubernetesJson(File f, Path dir) throws IOException
IOExceptionpublic 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 hasDependency(org.apache.maven.project.MavenProject project,
String groupId)
public static boolean hasPlugin(org.apache.maven.project.MavenProject project,
String plugin)
public static boolean hasClass(org.apache.maven.project.MavenProject project,
String... classNames)
public static Properties getSpringBootApplicationProperties(org.apache.maven.project.MavenProject project)
public static Properties getPropertiesFile(org.apache.maven.project.MavenProject project, String propertiesFileName)
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.MojoExecutionExceptionpublic static void createArchive(File sourceDir, File destinationFile, org.codehaus.plexus.archiver.zip.ZipArchiver archiver) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic static void createArchive(File sourceDir, File destinationFile, org.codehaus.plexus.archiver.jar.JarArchiver archiver) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic static String getVersion(String groupId, String artifactId) throws IOException
IOExceptionCopyright © 2016. All rights reserved.