public class EclipseWtpApplicationXMLWriter extends AbstractWtpResourceWriter
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
APPLICATION_XML_APPLICATION |
private static java.lang.String |
APPLICATION_XML_CONTEXT_ROOT |
private static java.lang.String |
APPLICATION_XML_DESCRIPTION |
private static java.lang.String |
APPLICATION_XML_DISPLAY_NAME |
private static java.lang.String |
APPLICATION_XML_FILENAME |
private static java.lang.String |
APPLICATION_XML_MODULE |
private static java.lang.String |
APPLICATION_XML_WEB |
private static java.lang.String |
APPLICATION_XML_WEB_URI |
private org.codehaus.plexus.util.xml.Xpp3Dom[] |
applicationXmlDomChildren |
private static java.lang.String |
HREF |
private static java.lang.String |
ID |
private static java.lang.String |
MODULEMAP_EARPROJECT_MAP |
private static java.lang.String |
MODULEMAPS_APPLICATION_EJB_MODULE |
private static java.lang.String |
MODULEMAPS_APPLICATION_WEB_MODULE |
private static java.lang.String |
MODULEMAPS_FILENAME |
private static java.lang.String |
MODULEMAPS_MAPPINGS |
private static java.lang.String |
MODULEMAPS_PROJECT_NAME |
private static java.lang.String |
MODULEMAPS_UTILITY_JARMAPPINGS |
private org.codehaus.plexus.util.xml.Xpp3Dom[] |
modulemapsXmlDomChildren |
private static java.lang.String |
URI |
private static java.lang.String |
VERSION |
private org.codehaus.plexus.util.xml.Xpp3Dom[] |
webModulesFromPoms |
private static java.lang.String |
XMI_ID |
private static java.lang.String |
XMI_TYPE |
private static java.lang.String |
XMI_VERSION |
private static java.lang.String |
XMLNS |
private static java.lang.String |
XMLNS_APPLICATION |
private static java.lang.String |
XMLNS_MODULEMAP |
private static java.lang.String |
XMLNS_SCHEMA_LOCATION |
private static java.lang.String |
XMLNS_XMI |
private static java.lang.String |
XMLNS_XSI |
private static java.lang.String |
XSI_SCHEMA_LOCATION |
ATTR_DEPLOY_NAME, ATTR_DEPLOY_PATH, ATTR_MODULE_ID, ATTR_MODULE_TYPE_ID, ATTR_NAME, ATTR_PROJECT_VERSION, ATTR_SOURCE_PATH, ATTR_VALUE, ELT_MODULE_TYPE, ELT_PROJECT_MODULES, ELT_PROPERTY, ELT_VERSION, ELT_WB_MODULE, ELT_WB_RESOURCEconfig, log| Constructor and Description |
|---|
EclipseWtpApplicationXMLWriter() |
| Modifier and Type | Method and Description |
|---|---|
private void |
copyApplicationFiles()
Copy all files from application directory to the target eclipseEar directory.
|
static void |
copyDirectoryStructure(java.io.File sourceDirectory,
java.io.File destinationDirectory)
Copies a entire directory structure without scm files.
|
private org.codehaus.plexus.util.xml.Xpp3Dom |
createNewApplicationXml()
there is no existing application.xml file so create a new one.
|
private org.codehaus.plexus.util.xml.Xpp3Dom |
createNewModulemaps()
there is no existing .modulemaps file so create a new one.
|
private org.codehaus.plexus.util.xml.Xpp3Dom |
findModuleInApplicationXml(org.codehaus.plexus.util.xml.Xpp3Dom applicationXmlDom,
org.codehaus.plexus.util.xml.Xpp3Dom mapping)
find an existing module entry in the application.xml file by looking up the id in the modulemaps file and then
using that to locate the entry in the application.xml file.
|
private org.codehaus.plexus.util.xml.Xpp3Dom |
findOrCreateArtifact(IdeDependency dependency,
org.codehaus.plexus.util.xml.Xpp3Dom modulemapXmlDom)
find an artifact in the modulemaps dom tree, if it is missing create a new entry in the modulemaps dom tree.
|
private java.lang.String |
getContextRootFor(IdeDependency dependency)
Find the contextRoot specified in the pom and convert it into contectroot for the application.xml.
|
private java.lang.String |
getIdFromMapping(org.codehaus.plexus.util.xml.Xpp3Dom mapping)
get the id from the href of a modulemap.
|
private void |
handled(org.codehaus.plexus.util.xml.Xpp3Dom xpp3Dom)
mark the domtree entry as handled (all not handled ones will be deleted).
|
private org.codehaus.plexus.util.xml.Xpp3Dom |
readXMLFile(java.io.File xmlFile)
read an xml file (application.xml or .modulemaps).
|
private void |
removeUnusedEntries(org.codehaus.plexus.util.xml.Xpp3Dom applicationXmlDom,
org.codehaus.plexus.util.xml.Xpp3Dom modulemapsXmlDom)
delete all unused entries from the dom-trees.
|
private void |
updateApplicationXml(org.codehaus.plexus.util.xml.Xpp3Dom applicationXmlDom,
org.codehaus.plexus.util.xml.Xpp3Dom modulemapXmlDom,
IdeDependency dependency)
update the application.xml and the .modulemaps file for a specified dependency.all WAR an EJB dependencies will
go in both files all others only in the modulemaps files.
|
void |
write()
write the application.xml and the .modulemaps file to the META-INF directory.
|
private void |
writePrettyXmlFile(java.io.File xmlFile,
org.codehaus.plexus.util.xml.Xpp3Dom xmlDomTree)
write back a domtree to a xmlfile and use the pretty print for it so that it is human readable.
|
addDependency, writeModuleTypeAccordingToPackaging, writeWarOrEarResourcesinitprivate static final java.lang.String APPLICATION_XML_APPLICATION
private static final java.lang.String APPLICATION_XML_CONTEXT_ROOT
private static final java.lang.String APPLICATION_XML_DESCRIPTION
private static final java.lang.String APPLICATION_XML_DISPLAY_NAME
private static final java.lang.String APPLICATION_XML_FILENAME
private static final java.lang.String APPLICATION_XML_MODULE
private static final java.lang.String APPLICATION_XML_WEB
private static final java.lang.String APPLICATION_XML_WEB_URI
private static final java.lang.String HREF
private static final java.lang.String ID
private static final java.lang.String MODULEMAP_EARPROJECT_MAP
private static final java.lang.String MODULEMAPS_APPLICATION_EJB_MODULE
private static final java.lang.String MODULEMAPS_APPLICATION_WEB_MODULE
private static final java.lang.String MODULEMAPS_FILENAME
private static final java.lang.String MODULEMAPS_MAPPINGS
private static final java.lang.String MODULEMAPS_PROJECT_NAME
private static final java.lang.String MODULEMAPS_UTILITY_JARMAPPINGS
private static final java.lang.String URI
private static final java.lang.String VERSION
private static final java.lang.String XMI_ID
private static final java.lang.String XMI_TYPE
private static final java.lang.String XMI_VERSION
private static final java.lang.String XMLNS
private static final java.lang.String XMLNS_APPLICATION
private static final java.lang.String XMLNS_MODULEMAP
private static final java.lang.String XMLNS_SCHEMA_LOCATION
private static final java.lang.String XSI_SCHEMA_LOCATION
private static final java.lang.String XMLNS_XMI
private static final java.lang.String XMLNS_XSI
private org.codehaus.plexus.util.xml.Xpp3Dom[] applicationXmlDomChildren
private org.codehaus.plexus.util.xml.Xpp3Dom[] modulemapsXmlDomChildren
private org.codehaus.plexus.util.xml.Xpp3Dom[] webModulesFromPoms
public void write()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - when writing the config files was not possibleAbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)private void copyApplicationFiles()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - wenn an error occures during file copieingpublic static void copyDirectoryStructure(java.io.File sourceDirectory,
java.io.File destinationDirectory)
throws java.io.IOException
sourceDirectory must exists.
sourceDirectory - destinationDirectory - java.io.IOExceptionprivate org.codehaus.plexus.util.xml.Xpp3Dom createNewApplicationXml()
private org.codehaus.plexus.util.xml.Xpp3Dom createNewModulemaps()
private org.codehaus.plexus.util.xml.Xpp3Dom findModuleInApplicationXml(org.codehaus.plexus.util.xml.Xpp3Dom applicationXmlDom,
org.codehaus.plexus.util.xml.Xpp3Dom mapping)
applicationXmlDom - application.xml dom treemapping - .modulemaps dom treeprivate org.codehaus.plexus.util.xml.Xpp3Dom findOrCreateArtifact(IdeDependency dependency, org.codehaus.plexus.util.xml.Xpp3Dom modulemapXmlDom)
dependency - dependency to findmodulemapXmlDom - dom-tree of modulemapsprivate java.lang.String getIdFromMapping(org.codehaus.plexus.util.xml.Xpp3Dom mapping)
mapping - the dom-tree of modulemapsprivate org.codehaus.plexus.util.xml.Xpp3Dom readXMLFile(java.io.File xmlFile)
xmlFile - an xmlfileprivate void handled(org.codehaus.plexus.util.xml.Xpp3Dom xpp3Dom)
xpp3Dom - dom element to mark handledprivate void removeUnusedEntries(org.codehaus.plexus.util.xml.Xpp3Dom applicationXmlDom,
org.codehaus.plexus.util.xml.Xpp3Dom modulemapsXmlDom)
applicationXmlDom - dom-tree of application.xmlmodulemapsXmlDom - dom-tree of modulemapsprivate void updateApplicationXml(org.codehaus.plexus.util.xml.Xpp3Dom applicationXmlDom,
org.codehaus.plexus.util.xml.Xpp3Dom modulemapXmlDom,
IdeDependency dependency)
applicationXmlDom - dom-tree of application.xmlmodulemapXmlDom - dom-tree of modulemapsdependency - the eclipse dependency to handleprivate java.lang.String getContextRootFor(IdeDependency dependency)
dependency - the artifact to searchprivate void writePrettyXmlFile(java.io.File xmlFile,
org.codehaus.plexus.util.xml.Xpp3Dom xmlDomTree)
throws org.apache.maven.plugin.MojoExecutionException
xmlFile - file to write toxmlDomTree - dom-tree to writeorg.apache.maven.plugin.MojoExecutionException - if the file could not be written