public abstract class AbstractEclipseManifestWriter extends AbstractEclipseWriter
Modifier and Type | Field and Description |
---|---|
protected static String |
MANIFEST_MF_FILENAME |
protected static String |
META_INF_DIRECTORY |
config, log
Constructor and Description |
---|
AbstractEclipseManifestWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDependencyToClassPath(StringBuilder classpath,
IdeDependency dependency)
Add one dependency to the blank separated classpath StringBuilder.
|
protected boolean |
areManifestsEqual(Manifest manifest,
Manifest existingManifest)
Check if the two manifests are equal.
|
protected String |
constructManifestClasspath()
Convert all dependencies in a blank seperated list of jars and projects representing the classpath.
|
protected Manifest |
createNewManifest()
Create a manifest contaigning the required classpath.
|
protected abstract String |
getMetaInfBaseDirectory(MavenProject project)
Search the project for the existing META-INF directory where the manifest should be located.
|
protected String |
orderClasspath(String newValue)
Aphabeticaly sort the classpath.
|
protected Manifest |
readExistingManifest(File manifestFile)
Read and parse the existing manifest file.
|
protected boolean |
shouldNewManifestFileBeWritten(Manifest manifest,
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. |
init
protected static final String MANIFEST_MF_FILENAME
protected static final String META_INF_DIRECTORY
protected String orderClasspath(String newValue)
newValue
- classpath to sortprotected Manifest readExistingManifest(File manifestFile) throws IOException
manifestFile
- fileIOException
- if the file could not be readprotected void addDependencyToClassPath(StringBuilder classpath, IdeDependency dependency)
classpath
- existing classpath to appenddependency
- dependency to append as jar or as projectprotected boolean areManifestsEqual(Manifest manifest, Manifest existingManifest)
manifest
- the new manifestexistingManifest
- to compaire the new one withprotected String constructManifestClasspath()
protected Manifest createNewManifest()
protected boolean shouldNewManifestFileBeWritten(Manifest manifest, File manifestFile) throws MojoExecutionException
manifest
- the newly created classpathmanifestFile
- the file where the manifestMojoExecutionException
protected abstract String getMetaInfBaseDirectory(MavenProject project) throws MojoExecutionException
MojoExecutionException
public void write() throws 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)MojoExecutionException
- when writing the config files was not possibleAbstractWtpResourceWriter#write(EclipseSourceDir[], ArtifactRepository, File)
Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.