public class PluginUtilities extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PluginUtilities.DependencyMatcher
Dependency filter.
|
static interface |
PluginUtilities.JenkinsTask
Jenkins runner.
|
Modifier and Type | Field and Description |
---|---|
static PluginUtilities.DependencyMatcher |
MATCH_ANY
Any dependency matcher.
|
static PluginUtilities.DependencyMatcher |
MATCH_SNAPSHOT
Snapshot dependency matcher.
|
static String |
SNAPSHOT
Maven snapshot version wildcard suffix.
|
Modifier and Type | Method and Description |
---|---|
static void |
changeField(Object instance,
String fieldName,
Object value)
Change known instance field.
|
static <T> T |
cloneDeep(T source)
Perform deep object clone.
|
static void |
ensureFields(org.apache.maven.model.Model model)
Validate model entries and create defaults.
|
static hudson.model.ListView |
ensureListView(String viewName)
Ensure jenkins list view with given name exists.
|
static void |
ensureProperty(hudson.model.AbstractProject project,
hudson.model.JobProperty property)
Replace project job property.
|
static String |
httpStringParam(String key,
Map<?,?> params)
Extract HTTP string parameter.
|
static boolean |
isExpression(String version)
Version contains some ${expression}.
|
static boolean |
isFailure(hudson.model.Result result)
Strict failure result.
|
static boolean |
isMemberBuild(hudson.model.AbstractBuild build)
Build originated by cascade action.
|
static boolean |
isProjectExists(String projectName)
Check if project exists.
|
static boolean |
isRelease(org.apache.maven.model.Model model)
Verify model version is not snapshot.
|
static boolean |
isRelease(org.apache.maven.model.Parent parent)
Verify model version is a snapshot.
|
static boolean |
isSameModuleName(hudson.maven.MavenModule one,
hudson.maven.MavenModule two)
Null-safe module name check.
|
static boolean |
isSnapshot(org.apache.maven.model.Dependency dependency)
Maven dependency version looks like snapshot.
|
static boolean |
isSnapshot(hudson.maven.MavenModule project)
Maven job version looks like snapshot.
|
static boolean |
isSnapshot(hudson.maven.MavenModuleSet project)
Maven job version looks like snapshot.
|
static boolean |
isSnapshot(org.apache.maven.model.Model model)
Maven model version looks like snapshot.
|
static boolean |
isSnapshot(org.apache.maven.model.Parent parent)
Parent version looks like snapshot.
|
static boolean |
isSnapshot(String version)
Version looks like snapshot.
|
static boolean |
isSuccess(hudson.model.Result result)
Strict success result.
|
static org.apache.maven.artifact.Artifact |
mavenArtifact(org.apache.maven.model.Dependency dependency)
Build maven artifact from maven dependency.
|
static org.apache.maven.artifact.Artifact |
mavenArtifact(org.apache.maven.model.Model model)
Build maven artifact from maven model.
|
static org.apache.maven.artifact.Artifact |
mavenArtifact(org.apache.maven.model.Parent parent)
Build maven artifact from maven parent.
|
static List<org.apache.maven.model.Dependency> |
mavenDependencies(hudson.FilePath pomFile,
PluginUtilities.DependencyMatcher matcher)
Collect matching dependencies from a pom.xml file.
|
static List<org.apache.maven.model.Dependency> |
mavenDependencies(hudson.maven.MavenModuleSet project,
PluginUtilities.DependencyMatcher matcher)
Maven top level project immediate dependencies.
|
static org.apache.maven.model.Model |
mavenModel(hudson.FilePath pomFile)
Parse pom.xml file into maven model.
|
static org.apache.maven.model.Model |
mavenModel(hudson.maven.MavenModuleSet project)
Extract maven model from jenkins project.
|
static hudson.maven.MavenModule |
mavenModule(hudson.model.AbstractBuild<?,?> build)
Top level jenkins maven module resolved from the build, or null.
|
static org.apache.maven.model.Parent |
mavenParent(hudson.FilePath pomFile)
Extract maven parent form a pom.xml file.
|
static org.apache.maven.model.Parent |
mavenParent(hudson.maven.MavenModuleSet project)
Find maven parent for a jenkins maven job.
|
static hudson.FilePath |
mavenPomFile(hudson.maven.MavenModuleSet project)
Project pom.xml file.
|
static hudson.maven.MavenModuleSet |
mavenProject(hudson.model.AbstractBuild<?,?> build)
Top level jenkins maven project resolved from the build, or null.
|
static hudson.maven.MavenModuleSet |
mavenProject(hudson.maven.ModuleName moduleName)
Find top level maven jenkins job with a module name.
|
static hudson.maven.MavenModuleSet |
mavenProject(String projectName)
Find top level maven jenkins job with a project name.
|
static List<hudson.maven.MavenModuleSet> |
mavenProjectList()
Find all top level maven jenkins jobs.
|
static String |
mavenReleaseVersion(String version)
Convert from any version to release version.
|
static String |
mavenSnapshotVersion(String version)
Convert from any version to snapshot version.
|
static hudson.maven.ModuleName |
moduleName(org.apache.maven.artifact.Artifact artifact)
Convert from maven artifact to jenkins module name.
|
static hudson.maven.ModuleName |
moduleName(org.apache.maven.model.Dependency dependency)
Build jenkins module name from maven dependency.
|
static hudson.maven.ModuleName |
moduleName(hudson.maven.MavenModuleSet project)
Build jenkins module name from jenkins project.
|
static hudson.maven.ModuleName |
moduleName(org.apache.maven.model.Model model)
Build jenkins module name from maven model.
|
static hudson.maven.ModuleName |
moduleName(org.apache.maven.model.Parent parent)
Build jenkins module name from maven parent.
|
static Set<String> |
moduleNameSet(List<hudson.maven.MavenModuleSet> moduleList)
Convert form project list to project names.
|
static Collection<hudson.model.TopLevelItem> |
projectList()
List of all projects in jenkins.
|
static Map<String,hudson.model.TopLevelItem> |
projectMap()
Map of all projects in jenkins.
|
static String |
relativePath(String base,
String path)
Path relative to base.
|
static String |
relativePath(URI baseURI,
URI pathURI)
Path relative to base.
|
static String |
tokenVariable(String tokenName)
Produce token variable entry from token name.
|
public static final PluginUtilities.DependencyMatcher MATCH_ANY
public static final PluginUtilities.DependencyMatcher MATCH_SNAPSHOT
public static final String SNAPSHOT
public static void changeField(Object instance, String fieldName, Object value) throws IOException
IOException
public static <T> T cloneDeep(T source)
public static void ensureFields(org.apache.maven.model.Model model)
public static hudson.model.ListView ensureListView(String viewName) throws IOException
IOException
public static void ensureProperty(hudson.model.AbstractProject project, hudson.model.JobProperty property) throws IOException
IOException
public static String httpStringParam(String key, Map<?,?> params)
public static boolean isExpression(String version)
public static boolean isFailure(hudson.model.Result result)
public static boolean isMemberBuild(hudson.model.AbstractBuild build)
public static boolean isProjectExists(String projectName)
public static boolean isRelease(org.apache.maven.model.Model model)
public static boolean isRelease(org.apache.maven.model.Parent parent)
public static boolean isSameModuleName(hudson.maven.MavenModule one, hudson.maven.MavenModule two)
public static boolean isSnapshot(org.apache.maven.model.Dependency dependency)
Missing dependency means dependency inherited from parent.
public static boolean isSnapshot(hudson.maven.MavenModule project) throws Exception
Exception
public static boolean isSnapshot(hudson.maven.MavenModuleSet project) throws Exception
Exception
public static boolean isSnapshot(org.apache.maven.model.Model model)
public static boolean isSnapshot(org.apache.maven.model.Parent parent)
public static boolean isSnapshot(String version)
public static boolean isSuccess(hudson.model.Result result)
public static org.apache.maven.artifact.Artifact mavenArtifact(org.apache.maven.model.Dependency dependency)
public static org.apache.maven.artifact.Artifact mavenArtifact(org.apache.maven.model.Model model)
public static org.apache.maven.artifact.Artifact mavenArtifact(org.apache.maven.model.Parent parent)
public static List<org.apache.maven.model.Dependency> mavenDependencies(hudson.FilePath pomFile, PluginUtilities.DependencyMatcher matcher) throws Exception
Exception
public static List<org.apache.maven.model.Dependency> mavenDependencies(hudson.maven.MavenModuleSet project, PluginUtilities.DependencyMatcher matcher) throws Exception
Exception
public static org.apache.maven.model.Model mavenModel(hudson.FilePath pomFile) throws IOException
IOException
public static org.apache.maven.model.Model mavenModel(hudson.maven.MavenModuleSet project) throws IOException
IOException
public static hudson.maven.MavenModule mavenModule(hudson.model.AbstractBuild<?,?> build)
public static org.apache.maven.model.Parent mavenParent(hudson.FilePath pomFile) throws Exception
Exception
public static org.apache.maven.model.Parent mavenParent(hudson.maven.MavenModuleSet project) throws Exception
Exception
public static hudson.FilePath mavenPomFile(hudson.maven.MavenModuleSet project)
public static hudson.maven.MavenModuleSet mavenProject(hudson.model.AbstractBuild<?,?> build)
public static hudson.maven.MavenModuleSet mavenProject(hudson.maven.ModuleName moduleName)
public static hudson.maven.MavenModuleSet mavenProject(String projectName)
public static List<hudson.maven.MavenModuleSet> mavenProjectList()
public static String mavenReleaseVersion(String version)
public static String mavenSnapshotVersion(String version)
public static hudson.maven.ModuleName moduleName(org.apache.maven.artifact.Artifact artifact)
public static hudson.maven.ModuleName moduleName(org.apache.maven.model.Dependency dependency)
public static hudson.maven.ModuleName moduleName(hudson.maven.MavenModuleSet project) throws IOException
IOException
public static hudson.maven.ModuleName moduleName(org.apache.maven.model.Model model)
public static hudson.maven.ModuleName moduleName(org.apache.maven.model.Parent parent)
public static Set<String> moduleNameSet(List<hudson.maven.MavenModuleSet> moduleList)
public static Collection<hudson.model.TopLevelItem> projectList()
Note: not affected by security filters.
public static Map<String,hudson.model.TopLevelItem> projectMap()
Note: not affected by security filters.
Copyright © 2004-2013 Barchart, Inc.. All Rights Reserved.