Skinny War file with Maven in Eclipse

192 Views Asked by At

I have a Maven project 'Project A' which contains dependencies. I have a requirement to abstract the dependencies from this project into another project called 'Shared Lib' so that I can make what is called a "Skinny War" file from Project A. Both these files will then be uploaded to a Weblogic server.

However, I am having a lot of difficulties being able to get Project A to pick up the dependencies in Shared Lib.

Some guidance on how I should approach this problem would be much appreciated.

Thanks!

1

There are 1 best solutions below

2
On

I would split the maven project into two modules. If we call one module SharedLib and the second one Skinny War then you will have something like:

<modules>
    <module>sharedLib</module>
    <module>skinnyWar</module>
</modules>

In the shared lib module pom.xml you will fill all the dependencies required for the project. In the skinnyWar module your first dependency in the list will be for the sharedLib module. You might need to setup the assembly plugin for the sharedLib module to create a jar in the package phase and you are good to go ;)

Some food of though - do you really want to do this? An important part about using maven is to take care of dependencies for you and package a easy to deploy jar. If you create two different jars it would cause all other kinds of troubles like - were both deployed. Are we using an older version of the dependencies etc.