Class MojoUtils


  • public class MojoUtils
    extends Object
    Author:
    kameshs
    • Field Detail

      • TEMPLATE_PROPERTY_QUARKUS_VERSION_NAME

        public static final String TEMPLATE_PROPERTY_QUARKUS_VERSION_NAME
        See Also:
        Constant Field Values
      • TEMPLATE_PROPERTY_QUARKUS_VERSION_VALUE

        public static final String TEMPLATE_PROPERTY_QUARKUS_VERSION_VALUE
      • TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_NAME

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_NAME
        See Also:
        Constant Field Values
      • TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_VALUE

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_VALUE
      • TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_NAME

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_NAME
        See Also:
        Constant Field Values
      • TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_VALUE

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_VALUE
      • TEMPLATE_PROPERTY_QUARKUS_PLATFORM_VERSION_NAME

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLATFORM_VERSION_NAME
        See Also:
        Constant Field Values
      • TEMPLATE_PROPERTY_QUARKUS_PLATFORM_VERSION_VALUE

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLATFORM_VERSION_VALUE
      • TEMPLATE_PROPERTY_QUARKUS_PLUGIN_VERSION_NAME

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLUGIN_VERSION_NAME
        See Also:
        Constant Field Values
      • TEMPLATE_PROPERTY_QUARKUS_PLUGIN_VERSION_VALUE

        public static final String TEMPLATE_PROPERTY_QUARKUS_PLUGIN_VERSION_VALUE
    • Method Detail

      • muteTransferListener

        public static org.eclipse.aether.RepositorySystemSession muteTransferListener​(org.eclipse.aether.RepositorySystemSession session)
      • hasDependency

        public static boolean hasDependency​(org.apache.maven.model.Model model,
                                            String groupId,
                                            String artifactId)
        Checks whether the project has the dependency
        Parameters:
        model - - the project to check existence of dependency
        groupId - - the dependency groupId
        artifactId - - the dependency artifactId
        Returns:
        true if the project has the dependency
      • parse

        public static org.apache.maven.model.Dependency parse​(String dependency)
      • configuration

        public static org.codehaus.plexus.util.xml.Xpp3Dom configuration​(MojoUtils.Element... elements)
        Builds the configuration for the goal using Elements
        Parameters:
        elements - A list of elements for the configuration section
        Returns:
        The elements transformed into the Maven-native XML format
      • plugin

        public static org.apache.maven.model.Plugin plugin​(String groupId,
                                                           String artifactId)
        Defines the plugin without its version or extensions.
        Parameters:
        groupId - The group id
        artifactId - The artifact id
        Returns:
        The plugin instance
      • plugin

        public static org.apache.maven.model.Plugin plugin​(String groupId,
                                                           String artifactId,
                                                           String version)
        Defines a plugin without extensions.
        Parameters:
        groupId - The group id
        artifactId - The artifact id
        version - The plugin version
        Returns:
        The plugin instance
      • plugin

        public static org.apache.maven.model.Plugin plugin​(String groupId,
                                                           String artifactId,
                                                           String version,
                                                           List<org.apache.maven.model.Dependency> dependencies)
        Defines a plugin.
        Parameters:
        groupId - The group id
        artifactId - The artifact id
        version - The plugin version
        dependencies - The plugin extensions
        Returns:
        The plugin instance
      • write

        public static void write​(org.apache.maven.model.Model model,
                                 File outputFile)
                          throws IOException
        Throws:
        IOException
      • credentials

        public static String credentials​(org.apache.maven.model.Dependency d)
      • getClassOrigin

        public static Path getClassOrigin​(Class<?> cls)
                                   throws IOException
        Returns the JAR or the root directory that contains the class file that is on the classpath of the context classloader
        Throws:
        IOException