|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter
org.apache.maven.plugin.eclipse.writers.AbstractEclipseManifestWriter
public abstract class AbstractEclipseManifestWriter
Common behaviours for creating or adapting the manifest files for eclipse environments.
Field Summary | |
---|---|
protected static java.lang.String |
MANIFEST_MF_FILENAME
|
protected static java.lang.String |
META_INF_DIRECTORY
|
Fields inherited from class org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter |
---|
config, log |
Constructor Summary | |
---|---|
AbstractEclipseManifestWriter()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.apache.maven.plugin.eclipse.writers.AbstractEclipseWriter |
---|
init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String MANIFEST_MF_FILENAME
protected static final java.lang.String META_INF_DIRECTORY
Constructor Detail |
---|
public AbstractEclipseManifestWriter()
Method Detail |
---|
protected java.lang.String orderClasspath(java.lang.String newValue)
newValue
- classpath to sort
protected java.util.jar.Manifest readExistingManifest(java.io.File manifestFile) throws java.io.IOException
manifestFile
- file
java.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 with
protected 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 manifest
org.apache.maven.plugin.MojoExecutionException
protected abstract java.lang.String getMetaInfBaseDirectory(org.apache.maven.project.MavenProject project) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
public 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |