Package io.quarkus.maven.utilities
Class MojoUtils
java.lang.Object
io.quarkus.maven.utilities.MojoUtils
- Author:
- kameshs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAttribute wrapper classstatic classCollection of attributes wrapper classstatic classElement wrapper class for configuration elements -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic org.codehaus.plexus.util.xml.Xpp3Domconfiguration(MojoUtils.Element... elements) Builds the configuration for the goal using Elementsstatic Stringcredentials(org.apache.maven.model.Dependency d) static PathgetClassOrigin(Class<?> cls) Returns the JAR or the root directory that contains the class file that is on the classpath of the context classloaderstatic PathgetResourceOrigin(ClassLoader cl, String name) static booleanhasDependency(org.apache.maven.model.Model model, String groupId, String artifactId) Checks whether the project has the dependencystatic org.eclipse.aether.RepositorySystemSessionmuteTransferListener(org.eclipse.aether.RepositorySystemSession session) static org.apache.maven.model.Dependencystatic org.apache.maven.model.PluginDefines the plugin without its version or extensions.static org.apache.maven.model.PluginDefines a plugin without extensions.static org.apache.maven.model.Pluginplugin(String groupId, String artifactId, String version, List<org.apache.maven.model.Dependency> dependencies) Defines a plugin.static String[]readGavFromPom(InputStream resourceAsStream) static String[]readGavFromSettingsGradle(ByteArrayInputStream buildFileInputStream, String[] gavIn) static org.apache.maven.model.Modelstatic org.apache.maven.model.ModelreadPom(InputStream resourceAsStream) static voidstatic voidwrite(org.apache.maven.model.Model model, OutputStream fileOutputStream) static voidwriteFormatted(org.apache.maven.model.Model model, File outputFile)
-
Field Details
-
JAVA_FILE_EXTENSION
- See Also:
-
KOTLIN_FILE_EXTENSION
- See Also:
-
SCALA_FILE_EXTENSION
- See Also:
-
JAVA_EXTENSION_NAME
- See Also:
-
KOTLIN_EXTENSION_NAME
- See Also:
-
SCALA_EXTENSION_NAME
- See Also:
-
TEMPLATE_PROPERTY_QUARKUS_VERSION_NAME
- See Also:
-
TEMPLATE_PROPERTY_QUARKUS_VERSION_VALUE
-
TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_NAME
- See Also:
-
TEMPLATE_PROPERTY_QUARKUS_PLATFORM_GROUP_ID_VALUE
-
TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_NAME
- See Also:
-
TEMPLATE_PROPERTY_QUARKUS_PLATFORM_ARTIFACT_ID_VALUE
-
TEMPLATE_PROPERTY_QUARKUS_PLATFORM_VERSION_NAME
- See Also:
-
TEMPLATE_PROPERTY_QUARKUS_PLATFORM_VERSION_VALUE
-
TEMPLATE_PROPERTY_QUARKUS_PLUGIN_VERSION_NAME
- See Also:
-
TEMPLATE_PROPERTY_QUARKUS_PLUGIN_VERSION_VALUE
-
-
Method Details
-
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 dependencygroupId- - the dependency groupIdartifactId- - the dependency artifactId- Returns:
- true if the project has the dependency
-
parse
-
configuration
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
Defines the plugin without its version or extensions.- Parameters:
groupId- The group idartifactId- 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 idartifactId- The artifact idversion- 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 idartifactId- The artifact idversion- The plugin versiondependencies- The plugin extensions- Returns:
- The plugin instance
-
readPom
- Throws:
IOException
-
readPom
- Throws:
IOException
-
readGavFromPom
- Throws:
IOException
-
write
- Throws:
IOException
-
writeFormatted
public static void writeFormatted(org.apache.maven.model.Model model, File outputFile) throws IOException - Throws:
IOException
-
write
public static void write(org.apache.maven.model.Model model, OutputStream fileOutputStream) throws IOException - Throws:
IOException
-
credentials
-
readGavFromSettingsGradle
public static String[] readGavFromSettingsGradle(ByteArrayInputStream buildFileInputStream, String[] gavIn) -
getClassOrigin
Returns the JAR or the root directory that contains the class file that is on the classpath of the context classloader- Throws:
IOException
-
getResourceOrigin
- Throws:
IOException
-