java.lang.Object
org.jenkinsci.plugins.pipeline.maven.util.XmlUtils

public class XmlUtils extends Object
Author:
Cyrille Le Clerc
  • Constructor Details

    • XmlUtils

      public XmlUtils()
  • Method Details

    • newMavenArtifact

      public static org.jenkinsci.plugins.pipeline.maven.MavenArtifact newMavenArtifact(Element artifactElt)
    • newMavenDependency

      public static org.jenkinsci.plugins.pipeline.maven.MavenDependency newMavenDependency(Element dependencyElt)
    • newPluginInvocation

      public static MavenSpyLogProcessor.PluginInvocation newPluginInvocation(Element pluginInvocationElt)
    • getUniqueChildElement

      @NonNull public static Element getUniqueChildElement(@NonNull Element element, @NonNull String childElementName)
    • getUniqueChildElementOrNull

      @Nullable public static Element getUniqueChildElementOrNull(@NonNull Element element, String... childElementName)
    • getChildrenElements

      @NonNull public static List<Element> getChildrenElements(@NonNull Element element, @NonNull String childElementName)
    • toString

      @NonNull public static String toString(@Nullable Node node)
    • getExecutionEvents

      @NonNull public static List<Element> getExecutionEvents(@NonNull Element mavenSpyLogs, String... expectedType)
    • getArtifactDeployedEvents

      @NonNull public static List<Element> getArtifactDeployedEvents(@NonNull Element mavenSpyLogs)
    • getArtifactDeployedEvent

      @Nullable public static Element getArtifactDeployedEvent(@NonNull List<Element> artifactDeployedEvents, @NonNull String filePath)
      Parameters:
      artifactDeployedEvents - list of "RepositoryEvent" of type "ARTIFACT_DEPLOYED"
      filePath - file path of the artifact we search for
      Returns:
      The "RepositoryEvent" of type "ARTIFACT_DEPLOYED" or null if non found
    • getExecutionEventsByPlugin

      @NonNull public static List<Element> getExecutionEventsByPlugin(@NonNull Element mavenSpyLogs, String pluginGroupId, String pluginArtifactId, String pluginGoal, String... eventType)
    • getExecutedLifecyclePhases

      @NonNull public static List<String> getExecutedLifecyclePhases(@NonNull Element mavenSpyLogs)
    • getPathInWorkspace

      @NonNull public static String getPathInWorkspace(@NonNull String absoluteFilePath, @NonNull FilePath workspace)
      Relativize path

      TODO replace all the workarounds (JENKINS-44088, JENKINS-46084, mac special folders...) by a unique call to File.getCanonicalPath() on the workspace for the whole "MavenSpyLogProcessor#processMavenSpyLogs" code block. We donb't want to pay an RPC call to File.getCanonicalPath() each time.

      Returns:
      relativized path
      Throws:
      IllegalArgumentException - if other is not a Path that can be relativized against this path
      See Also:
    • isWindows

      @Deprecated public static boolean isWindows(@NonNull FilePath path)
    • getFileSeparatorOnRemote

      @NonNull public static String getFileSeparatorOnRemote(@NonNull FilePath filePath)
      Return the File separator "/" or "\" that is effective on the remote agent.
      Parameters:
      filePath -
      Returns:
      "/" or "\"
    • getProjectBuildDirectory

      @Nullable public static String getProjectBuildDirectory(@NonNull Element projectElt)
      Parameters:
      projectElt -
      Returns:
      project/build/@directory"
    • join

      @NonNull public static String join(@NonNull Iterable<String> elements, @NonNull String delimiter)
      Concatenate the given elements using the given delimiter to concatenate.
    • listGeneratedArtifacts

      @NonNull public static List<org.jenkinsci.plugins.pipeline.maven.MavenArtifact> listGeneratedArtifacts(Element mavenSpyLogs, boolean includeAttachedArtifacts)