public abstract class AbstractEclipseManifestWriter extends AbstractEclipseWriter
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
MANIFEST_MF_FILENAME |
protected static java.lang.String |
META_INF_DIRECTORY |
config, log| Constructor and Description |
|---|
AbstractEclipseManifestWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDependencyToClassPath(java.lang.StringBuffer classpath,
IdeDependency dependency)
Add one dependency to the blank separated classpath stringbuffer.
|
protected boolean |
areManifestsEqual(java.util.jar.Manifest manifest,
java.util.jar.Manifest existingManifest)
Check if the two manifests are equal.
|
protected java.lang.String |
constructManifestClasspath()
Convert all dependencies in a blank seperated list of jars and projects representing the classpath.
|
protected java.util.jar.Manifest |
createNewManifest()
Create a manifest contaigning the required classpath.
|
protected abstract java.lang.String |
getMetaInfBaseDirectory(org.apache.maven.project.MavenProject project)
Search the project for the existing META-INF directory where the manifest should be located.
|
protected java.lang.String |
orderClasspath(java.lang.String newValue)
Aphabeticaly sort the classpath.
|
protected java.util.jar.Manifest |
readExistingManifest(java.io.File manifestFile)
Read and parse the existing manifest file.
|
protected boolean |
shouldNewManifestFileBeWritten(java.util.jar.Manifest manifest,
java.io.File manifestFile)
Verify is the manifest sould be overwritten this sould take in account that the manifest should only be written
if the contents of the classpath was changed not the order.
|
void |
write()
If the existing manifest file located in
getMetaInfBaseDirectory() already has a correct
MANIFEST_VERSION and CLASS_PATH value then do nothing. |
initprotected static final java.lang.String MANIFEST_MF_FILENAME
protected static final java.lang.String META_INF_DIRECTORY
protected java.lang.String orderClasspath(java.lang.String newValue)
newValue - classpath to sortprotected java.util.jar.Manifest readExistingManifest(java.io.File manifestFile)
throws java.io.IOException
manifestFile - filejava.io.IOException - if the file could not be readprotected void addDependencyToClassPath(java.lang.StringBuffer classpath,
IdeDependency dependency)
classpath - existing classpath to appenddependency - dependency to append as jar or as projectprotected boolean areManifestsEqual(java.util.jar.Manifest manifest,
java.util.jar.Manifest existingManifest)
manifest - the new manifestexistingManifest - to compaire the new one withprotected java.lang.String constructManifestClasspath()
protected java.util.jar.Manifest createNewManifest()
protected boolean shouldNewManifestFileBeWritten(java.util.jar.Manifest manifest,
java.io.File manifestFile)
throws org.apache.maven.plugin.MojoExecutionException
manifest - the newly created classpathmanifestFile - the file where the manifestorg.apache.maven.plugin.MojoExecutionExceptionprotected abstract java.lang.String getMetaInfBaseDirectory(org.apache.maven.project.MavenProject project)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void write()
throws org.apache.maven.plugin.MojoExecutionException
getMetaInfBaseDirectory() already has a correct
MANIFEST_VERSION and CLASS_PATH value then do nothing.
Otherwise generate a NEW (i.e the old one is overwritten) which only contains values for MANIFEST_VERSION and CLASS_PATH, all other previous entries are not kept.
sourceDirs - all eclipse source directoryslocalRepository - the local reposetorybuildOutputDirectory - build output directory (target)org.apache.maven.plugin.MojoExecutionException - when writing the config files was not possibleAbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)