I had to do this a while back so it might have changed in a more
recent build, but when I had something like this, I just had to
specify my own complete MANIFEST.MF file and tell Maven to use it
instead of generating one. You either took the Maven-generated
Manifest or built your own entirely (at the time).

This sounds like something that could be useful (merging your own
Manifest with the Maven-generated one) so I'd expect its already an
RFE in JIRA and possibly has been implemented in a Snapshot build.
Check JIRA and see what you can find.

Wayne

On 1/12/07, Ján Ďurovec <[EMAIL PROTECTED]> wrote:
Hi!

I would like to create a project with the following structure of the final build

<baseDir>
 +- conf/
 |   +- <my confg .xml and .properties files>
 +- lib/
 |   +- dep1.jar, dep2.jar
 +- myAp.jar <executable>

I would like myApp to be able to access the configuration files, which can be manually 
achieved by putting "Class-Path: conf/ lib/dep1.jar lib/dep2.jar" into 
myApp.jar's manifest.

I have tried putting
<plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <archive>
            <manifest>
                <addClasspath>true</addClasspath>
                <classpathPrefix>lib</classpathPrefix>
                <mainClass>${mainclass}</mainClass>
            </manifest>
        </archive>
    </configuration>
</plugin>
into pom.xml but it only generates the "lib/dep1.jar lib/dep2.jar" part.

Adding
            <manifestFile>merge/MANITEST.MF</manifestFile>
after the <manifest> element, where the "merge/MANIFEST.MF" file contains only single 
line "Class-Path: conf/" caused the whole classpath section to be replaced in the resulting 
manifest (i.e. there were no dependencies).

Is there a way how to achieve the desired result using Maven so I do not need to manually 
add the "conf/" to the jar's manifest after every build?

Jan

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


Reply via email to