|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.apache.maven.MavenUtils
Utilities for reading maven project descriptors, profile descriptors and workspace descriptors.
| Constructor Summary | |
|---|---|
MavenUtils()
|
|
| Method Summary | |
|---|---|
static org.apache.commons.betwixt.io.BeanReader |
createBeanReader(java.lang.Class clazz)
Creates a new instance of BeanReader |
static MavenJellyContext |
createContext(java.io.File descriptorDirectory)
Create a jelly context given a descriptor directory. |
static MavenJellyContext |
createContext(java.io.File descriptorDirectory,
MavenJellyContext parentContext)
Create a jelly context given a descriptor directory and parent jelly context. |
static void |
displayClassLoaderContents(com.werken.forehead.ForeheadClassLoader classLoader)
Debugging function. |
static java.lang.String[] |
getFiles(java.io.File directory,
java.lang.String includes)
Get a set of files from a specifed directory with a set of includes. |
static java.lang.String[] |
getFiles(java.io.File directory,
java.lang.String includes,
java.lang.String excludes)
Get a set of files from a specifed directory with a set of includes. |
static java.util.List |
getGoalListFromCsv(java.lang.String goalCsv)
Get a list of goals from a CSV list. |
static java.lang.String |
getMessage(java.lang.String messageId)
Retrieve a user message. |
static java.lang.String |
getMessage(java.lang.String messageId,
java.lang.Object variable)
Retrieve a user message. |
static Project |
getProject(java.io.File projectDescriptor)
Create a Project object given a file descriptor. |
static Project |
getProject(java.io.File projectDescriptor,
MavenJellyContext parentContext)
Create a Project object given a file descriptor, and a parent context |
static Project |
getProject(java.io.File projectDescriptor,
MavenJellyContext parentContext,
boolean useParentPom)
Create a Project object given a file descriptor and optionally a parent Jelly context. |
static java.io.InputStream |
getProjectInputStream(Project project)
|
static java.util.List |
getProjects(java.io.File directory,
java.lang.String includes,
java.lang.String excludes)
This is currently used for the reactor but may be generally useful. |
static java.util.List |
getProjects(java.io.File directory,
java.lang.String includes,
java.lang.String excludes,
MavenJellyContext context)
This is currently used for the reactor but may be generally useful. |
static org.apache.commons.betwixt.XMLIntrospector |
getXMLIntrospector()
If caching is enabled then this method will return a pooled introspector |
static org.xml.sax.XMLReader |
getXMLReader()
Get the XMLReader to use for processing XML related resources. |
static void |
integrateMapInContext(java.util.Map map,
MavenJellyContext context)
Integrate a Map of key:value pairs into a MavenJellyContext. |
static java.lang.String |
makeAbsolutePath(java.io.File basedir,
java.lang.String dir)
Resolve directory against a base directory if it is not already absolute. |
static java.lang.String |
makeRelativePath(java.io.File basedir,
java.lang.String path)
Convert an absolute path to a relative path if it is under a given base directory. |
static java.util.Map |
mergeMaps(java.util.Map[] maps)
Take a series of Maps and merge
them where the ordering of the array from 0..n
is the dominant order. |
static java.util.Map |
mergeMaps(java.util.Map dominantMap,
java.util.Map recessiveMap)
Take a dominant and recessive Map and merge the key:value pairs where the recessive Map may add key:value pairs to the dominant Map but may not override any existing key:value pairs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MavenUtils()
| Method Detail |
public static Project getProject(java.io.File projectDescriptor)
throws MavenException
projectDescriptor - a maven project.xml
MavenException - when any errors occur
public static Project getProject(java.io.File projectDescriptor,
MavenJellyContext parentContext)
throws MavenException
projectDescriptor - The file to create the project fromparentContext - the parent Maven Jelly Context
MavenException - when any error happens.
public static Project getProject(java.io.File projectDescriptor,
MavenJellyContext parentContext,
boolean useParentPom)
throws MavenException
projectDescriptor - a maven project.xml FileparentContext - the parent context for the new projectuseParentPom - whether a parent project should be respected
MavenException - when any errors occur
public static java.util.List getProjects(java.io.File directory,
java.lang.String includes,
java.lang.String excludes)
throws MavenException
directory - the directory to scan for maven projectsincludes - the pattern that matches a project that you want includedexcludes - the pattern that matches a project that you don't want included
Projects
MavenException - when anything goes wrong.
public static java.util.List getProjects(java.io.File directory,
java.lang.String includes,
java.lang.String excludes,
MavenJellyContext context)
throws MavenException
directory - the directory to scan for maven projectsincludes - Patterns to include.excludes - Patterns to exclude.context - the parent context
Projects
MavenException - when anything goes wrong.
public static java.io.InputStream getProjectInputStream(Project project)
throws MavenException
project - a maven project
InputStream for the given project
MavenException - when reading the project
public static java.lang.String[] getFiles(java.io.File directory,
java.lang.String includes)
directory - Directory to scan.includes - Comma separated list of includes.
public static java.lang.String[] getFiles(java.io.File directory,
java.lang.String includes,
java.lang.String excludes)
directory - Directory to scan.includes - Comma separated list of includes.excludes - Comma separated list of excludes.
public static org.apache.commons.betwixt.io.BeanReader createBeanReader(java.lang.Class clazz)
throws java.beans.IntrospectionException,
org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException
clazz - the class to register with the reader
bean reader
java.beans.IntrospectionException - when there are errors registering the provided class
org.xml.sax.SAXException - when there are errors getting an XML reader
javax.xml.parsers.ParserConfigurationException - when there are errors getting an XML readerpublic static org.apache.commons.betwixt.XMLIntrospector getXMLIntrospector()
public static org.xml.sax.XMLReader getXMLReader()
throws org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException - when the reader can't be created
javax.xml.parsers.ParserConfigurationException - when the reader can't be created
public static java.util.Map mergeMaps(java.util.Map dominantMap,
java.util.Map recessiveMap)
dominantMap - Dominant Map.recessiveMap - Recessive Map.
public static java.util.Map mergeMaps(java.util.Map[] maps)
Maps and merge
them where the ordering of the array from 0..n
is the dominant order.
maps - An array of Maps to merge.
public static MavenJellyContext createContext(java.io.File descriptorDirectory)
descriptorDirectory - The directory from which to pull the standard maven
properties files from.
public static MavenJellyContext createContext(java.io.File descriptorDirectory,
MavenJellyContext parentContext)
descriptorDirectory - The directory from which to pull the standard maven
properties files from.parentContext - The parent jelly context.
public static void integrateMapInContext(java.util.Map map,
MavenJellyContext context)
MavenJellyContext.
The values in the Map may be CompositeExpressions that need
to be evaluated before being placed into the context.
map - Map to integrate into the provided jelly context.context - Jelly context to integrate the map into.public static java.lang.String getMessage(java.lang.String messageId)
messageId - Id of message type to use.
public static java.lang.String getMessage(java.lang.String messageId,
java.lang.Object variable)
messageId - Id of message type to use.variable - Value to substitute for ${1} in the given message.
public static java.lang.String makeAbsolutePath(java.io.File basedir,
java.lang.String dir)
throws java.io.IOException
basedir - the base directory for relative pathsdir - the directory to resolve
java.io.IOException - if canonical path fails
public static java.lang.String makeRelativePath(java.io.File basedir,
java.lang.String path)
throws java.io.IOException
basedir - the base directory for relative pathspath - the directory to resolve
java.io.IOException - if canonical path failspublic static java.util.List getGoalListFromCsv(java.lang.String goalCsv)
goalCsv - the goals
public static void displayClassLoaderContents(com.werken.forehead.ForeheadClassLoader classLoader)
classLoader - the class loader
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||