Surendran D
2013-11-06 08:54:59 UTC
Hi,
I am currently building and EAR file using maven-ear-plugin
I have a requirement to exclude some of the Class-Path: entries from
MANIFEST.MF file.
For example I have 3 dependencies hibernate-core.jar, quartz-1.6.5.jar and
poi-3.7.jar in my class path (in my dependency of pom.xml)
When I build my EAR file all these entries will be automatically added to
Class-Path entry of my MANIFEST.MF file.
My maven build looks as follows
<build>
<finalName>MyEAR</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addClasspath>true</addClasspath>
<addExtensions />
<classpathPrefix />
</manifest>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF
</manifestFile>
</archive>
.....
.....
</configuration>
</plugin>
</plugins>
</build>
In the above build file
<addClasspath>true</addClasspath>
is responsible for adding the MANIFEST.MF entries.
My requirement is to add only 2 jars in dependency quartz-1.6.5.jar and
poi-3.7.jar and exlcude the remaning.
If I give false all the entries are excluded from the MANIFEST.MF
classpath. If the remove the depependecy entries from pom I get compilation
errors.
how can I achieve the above scenario.
thanks,
I am currently building and EAR file using maven-ear-plugin
I have a requirement to exclude some of the Class-Path: entries from
MANIFEST.MF file.
For example I have 3 dependencies hibernate-core.jar, quartz-1.6.5.jar and
poi-3.7.jar in my class path (in my dependency of pom.xml)
When I build my EAR file all these entries will be automatically added to
Class-Path entry of my MANIFEST.MF file.
My maven build looks as follows
<build>
<finalName>MyEAR</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addClasspath>true</addClasspath>
<addExtensions />
<classpathPrefix />
</manifest>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF
</manifestFile>
</archive>
.....
.....
</configuration>
</plugin>
</plugins>
</build>
In the above build file
<addClasspath>true</addClasspath>
is responsible for adding the MANIFEST.MF entries.
My requirement is to add only 2 jars in dependency quartz-1.6.5.jar and
poi-3.7.jar and exlcude the remaning.
If I give false all the entries are excluded from the MANIFEST.MF
classpath. If the remove the depependecy entries from pom I get compilation
errors.
how can I achieve the above scenario.
thanks,