Skip to content

SharedModule

Vishal Pawar edited this page Dec 24, 2020 · 7 revisions

Shared Modules with Maven

When shared module project is present in the workspace

Step 1

Create an application project "Sample" and a shared Module "logging". Refer subprocess from the shared module in your application module.

Step 2

Generate POM for your Application by right clicking on the Application and choosing the 'Generate POM for Application' menu item. The wizard should list down all the shared modules referenced by the application.

The parent project pom.xml should list down all the modules as below -

<modules>
    <module>../Logging</module>
    <module>../Sample.module</module>
    <module>../Sample</module>
</modules>

If a new shared module is added after mavenizing the project. You can launch 'Generate POM for Application' wizard again to regenerate pom.xml files.

External Shared Modules with Maven

Accessing Shared Modules without importing them in the workspace

This feature is only supported from BW 6.4.2 and BWCE 2.3.2. You will need the Studio from these versions. Earlier versions do not support this feature

Step 1

Create new Shared Module project - "LoggingModule". Right Click, Select option "Generate POM for Shared Module". It will mavenize the project and generates pom.xml for the shared module.

Step 2

Create new "Run\Debug Configuration" for Maven. Select shared module project and execute "clean install" goal. This will install the shared module in local .m2 repository.

Step 3

Open new eclipse workspace. Create new application project.

Step 4

Generate POM for your Application by right clicking on the Application and choosing the 'Generate POM for Application' menu item.

Step 5

Open the Application Module pom.xml and add the shared module dependency which is present in your local maven repository. In this example I have a LoggingModule jar file which is in my ~/.m2/repository folder

Save your pom.xml

You should now see the Shared Module in the Studio Project Explorer. Note the different icon for the project which indicates that the Shared Module is referenced and not in the workspace.

Clone this wiki locally