Figured it out: you can specify manifest entry and configure class path
at the same time. The result will be additive:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                                <Class-Path>config/ </Class-Path>
                            </manifestEntries>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
 
<mainClass>com.barclaysglobal.asgintl.cmdlnfrmwrk.CommandProcessor</main
Class>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
Produces
Class-Path: config/ lib/commons-lang-2.3.jar lib/log4j-1.2..... Etc.
which is exaclty what I need.

> _____________________________________________ 
> From:         Naftulin, Henry BGI SF  
> Sent: Friday, March 14, 2008 12:10 PM
> To:   '[email protected]'
> Subject:      Executable jar with extra directory for configuration
> files [ASGI]
> 
> I have a rather simple, common problems, that probably was solved
> before. I looked at both jar and assembly plug-in and did not find the
> answer.
> I have to produce an executable jar with dependencies and with
> configuration files that I'd like to be stored outside of the jar,
> like the following:
> exec.jar 
> lib/dependecy.jar 
> config/configfile.prop 
> I was able to produce the structure, but I can't seem to figure out
> how to add/modify manifest.mf file inside the exec.jar to have config
> directory (which is external to all jars since we need to be able to
> change the configuration) be added to the path. I have no problem
> listing all the dependencies in lib directory, but is there a way to
> prepend or append that extra config directory to manifest.mf? 
> Is there an option I can use in either jar plug-in or assembly
> plug-in? Is there any other plug-in that I can use for this purpose?
> Thank you, 
> Henry 
> 
 
-- 
 
This message and any attachments are confidential, proprietary, and may be 
privileged.  If this message was misdirected, Barclays Global Investors (BGI) 
does not waive any confidentiality or privilege.  If you are not the intended 
recipient, please notify us immediately and destroy the message without 
disclosing its contents to anyone.  Any distribution, use or copying of this 
e-mail or the information it contains by other than an intended recipient is 
unauthorized.  The views and opinions expressed in this e-mail message are the 
author's own and may not reflect the views and opinions of BGI, unless the 
author is authorized by BGI to express such views or opinions on its behalf.  
All email sent to or from this address is subject to electronic storage and 
review by BGI.  Although BGI operates anti-virus programs, it does not accept 
responsibility for any damage whatsoever caused by viruses being passed.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to