Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

os Maven plugin, dependencies and lib folders

What determines the contents of 'lib' and 'shared-lib' folders when using the os Maven plugin?

You specify dependencies and their scope (compile, provided, test e.t.c.) in the pom.xml but it is not clear to me what jars are put in the two separate lib folder in the resulting PU structure.

This thread continues /[/question/6252/maven-and-lookup-groups/?comment=6256#comment-6256] and /[/question/6257/noclassdeffounderror-on-deploying-mirror-service/?comment=6260#comment-6260]

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2367]{quote}

asked 2008-06-02 08:46:46 -0500

niklasuhrberg gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

OS plugin uses the maven assembly plugin to generate the PU directory structure. One of its tasks is to determine which jars go into the lib directory and which go into the shared-lib directory. Each PU module has the file <module-name>/src/main/assembly/assembly.xml which defines the assembly structure. Inside this file we have a dependencySets element that contains two dependencySet elements.

The first dependencySet (where its outputDirectory=lib) defines which jars go into the lib directory in the PU structure. It excludes the dependency in the common module and its transitive dependencies. In other words, all dependencies that are not related to the commons module will go into the lib directory. +<dependencySet>+ +<useProjectArtifact>false</useProjectArtifact>+ +<useTransitiveDependencies>false</useTransitiveDependencies>+ +<outputDirectory>lib</outputDirectory>+ +<excludes>+ +<exclude>com.mycompany.app:common</exclude>+ +</excludes>+ +</dependencySet>+

The second dependencySet (where its outputDirectory=shared-lib) defines which jars go into the shared-lib directory in the PU structure. It includes the dependency in common module and its transitive dependencies, leaving other dependencies out. In other words, all dependencies that are related to the commons module will go into the shared-lib directory. +<dependencySet>+ +<useProjectArtifact>false</useProjectArtifact>+ +<useTransitiveDependencies>true</useTransitiveDependencies>+ +<useTransitiveFiltering>true</useTransitiveFiltering>+ +<outputDirectory>shared-lib</outputDirectory>+ +<includes>+ +<include>com.mycompany.app:common</include>+ +</includes>+ +</dependencySet>+

When the scope of a module dependency is compile, that dependency will be added to the PU distributable. When the scope of a module dependency is provided, that dependency will not be added to the PU distributable.

I will add comprehensive instructions to the OpenSpaces Plugin for Maven page in the wiki.

Edited by: Shai Wolf on Jun 3, 2008 3:58 AM

answered 2008-06-03 03:56:00 -0500

shaiw gravatar image
edit flag offensive delete link more
0

Thanks for the excellent answer!

answered 2008-06-03 08:02:19 -0500

niklasuhrberg gravatar image
edit flag offensive delete link more

Comments

The OpenSpaces Maven Plugin wiki page:
http://www.gigaspaces.com/wiki/display/OLH/OpenSpacesMavenPlugin
FYI

Cheers,
Shai

shaiw gravatar imageshaiw ( 2008-06-03 08:33:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-06-02 08:46:46 -0500

Seen: 140 times

Last updated: Jun 03 '08