Class XmlUtils
java.lang.Object
org.jenkinsci.plugins.pipeline.maven.util.XmlUtils
- Author:
- Cyrille Le Clerc
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
CopyRestrictiveEntityResolver
as it is secured byNoExternalUse
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Element
getArtifactDeployedEvent
(List<Element> artifactDeployedEvents, String filePath) getArtifactDeployedEvents
(Element mavenSpyLogs) getChildrenElements
(Element element, String childElementName) getExecutedLifecyclePhases
(Element mavenSpyLogs) getExecutionEvents
(Element mavenSpyLogs, String... expectedType) getExecutionEventsByPlugin
(Element mavenSpyLogs, String pluginGroupId, String pluginArtifactId, String pluginGoal, String... eventType) static String
getFileSeparatorOnRemote
(FilePath filePath) Return the File separator "/" or "\" that is effective on the remote agent.static String
getPathInWorkspace
(String absoluteFilePath, FilePath workspace) Relativize pathstatic String
getProjectBuildDirectory
(Element projectElt) static Element
getUniqueChildElement
(Element element, String childElementName) static Element
getUniqueChildElementOrNull
(Element element, String... childElementName) static boolean
Deprecated.static String
Concatenate the givenelements
using the givendelimiter
to concatenate.static List<org.jenkinsci.plugins.pipeline.maven.MavenArtifact>
listGeneratedArtifacts
(Element mavenSpyLogs, boolean includeAttachedArtifacts) static org.jenkinsci.plugins.pipeline.maven.MavenArtifact
newMavenArtifact
(Element artifactElt) static org.jenkinsci.plugins.pipeline.maven.MavenDependency
newMavenDependency
(Element dependencyElt) newPluginInvocation
(Element pluginInvocationElt) static String
-
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
-
getUniqueChildElementOrNull
-
getChildrenElements
-
toString
-
getExecutionEvents
-
getArtifactDeployedEvents
-
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
-
getExecutedLifecyclePhases
-
getPathInWorkspace
@NonNull public static String getPathInWorkspace(@NonNull String absoluteFilePath, @NonNull FilePath workspace) Relativize pathTODO 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 toFile.getCanonicalPath()
each time.- Returns:
- relativized path
- Throws:
IllegalArgumentException
- ifother
is not aPath
that can be relativized against this path- See Also:
-
isWindows
Deprecated. -
getFileSeparatorOnRemote
Return the File separator "/" or "\" that is effective on the remote agent.- Parameters:
filePath
-- Returns:
- "/" or "\"
-
getProjectBuildDirectory
- Parameters:
projectElt
-- Returns:
project/build/@directory"
-
join
Concatenate the givenelements
using the givendelimiter
to concatenate. -
listGeneratedArtifacts
-
FileUtils.isWindows(FilePath)