Processing unit assembly definition.
This page contains information beyond the basics. It was created for those who want to know a little bit more about how OpenSpaces and Maven integrate. Basically, the information given in OpenSpaces Maven Plugin should be sufficient for the common user.
Processing Unit Assembly Definition
The OpenSpaces maven plugin uses the maven assembly plugin to generate the processing unit directory structure. Each PU module has the file <module-name>/src/main/assembly/assembly.xml that defines the assembly structure. One of its tasks is to determine which of the dependency JARS go into the lib directory and which go into the shared-lib directory.
Dependencies Target Locations
Inside assembly.xml 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 go into the lib directory.
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 go into the shared-lib directory.
When defining a dependency for an artifact (module), you can specify the dependency's scope. Scope determines which dependencies participate in the build lifecycle.
Maven defines the following scopes:
|| Indicates that the dependency is available for the classpaths of all phases. This is the default scope.
|| Indicates that the dependency is available on the compile classpath, but in the production environment you expect the JDK or a container to provide it. It is not transitive.
|| Indicates that the dependency is only available for the test compilation and execution phases.
|| Indicates that the dependency is available for the runtime and test classpaths, but not for the compile classpath.
|| This scope is similar to provided, except that you have to provide the JAR location explicitly. The artifact is not looked up in a repository. Using this scope is not advised due to portability issues.
During processing unit packaging only dependencies declared with the scopes compile and runtime are added to the PU distributable.
For more information go to Introduction to the Dependency Mechanism
Configuring Maven to use the Assembly Descriptor
To instruct Maven to use this assembly descriptor to generate the processing units, we configure the assembly plugin by adding the following xml snippet to the module's pom.xml file.
For further information about the assembly plugin options, go to: