views:

32

answers:

1

Hi All,

We have replaced ejbs with Spring transaction and security(service facade) in our project. Earlier we were using maven ejb plugin to include dependent libs in the classpath.

        <plugin>
            <artifactId>maven-ejb-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

It was generating MANIFEST.MF file with all jar dependencies in ejb artifact (all jar files in ear folder in Jboss 4.2).

Since we have removed the ejbs now, session facade is an jar artifact. I don't know, how to generate MANIFEST.MF in the session facade with all jar dependencies using maven.

I have an option to specify includeInApplicationXml attribute to include jar files in application.xml file as java module but I would have to specify it for each and every jar which is a cumbersome process as jar files dependency kept on changing.

Do we have any way to include jar file dependency without listing them in application.xml. Lets say we include only sessionfacade.jar dependency in application.xml and generate MANIFEST.MF file having dependency of all other jars (the way it was happening using maven-ejb-plugin).

Any help will be highly appreciated. Thanks in advance.

A: 

you can use the same maven configuration, but with the maven-jar-plugin:

<plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <archive>
            <manifest>
                <addClasspath>true</addClasspath>
            </manifest>
        </archive>
    </configuration>
</plugin>

This will generate the MANIFEST.MF with all dependencies on the class-path element.

Salandur
Thanks a ton! This is exactly I was look for.
this works for almost all packaging plugins where a manifest can be used. see http://maven.apache.org/shared/maven-archiver/index.html
Salandur