Summary: Processing unit assembly definition.
DescriptionThis 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 DefinitionThe 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. assembly.xml <assembly> <id>assemble-pu</id> <formats> <format>jar</format> <format>dir</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <fileSets> <fileSet> <directory>target/classes</directory> <lineEnding>keep</lineEnding> <outputDirectory>/</outputDirectory> <includes> <include>**/**</include> </includes> </fileSet> </fileSets> <dependencySets> <dependencySet> <useProjectArtifact>false</useProjectArtifact> <useTransitiveDependencies>false</useTransitiveDependencies> <outputDirectory>lib</outputDirectory> <excludes> <exclude>com.mycompany.app:common</exclude> </excludes> </dependencySet> <dependencySet> <useProjectArtifact>false</useProjectArtifact> <useTransitiveDependencies>true</useTransitiveDependencies> <useTransitiveFiltering>true</useTransitiveFiltering> <outputDirectory>shared-lib</outputDirectory> <includes> <include>com.mycompany.app:common</include> </includes> </dependencySet> </dependencySets> </assembly> Dependencies Target LocationsInside assembly.xml we have a dependencySets element that contains two dependencySet elements. 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. Dependency ScopesWhen 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:
For more information go to Introduction to the Dependency Mechanism Configuring Maven to use the Assembly DescriptorTo 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. pom.xml <build> ... <finalName>testing-feeder</finalName> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <appendAssemblyId>false</appendAssemblyId> <attach>false</attach> <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions> <descriptors> <descriptor>src/main/assembly/assembly.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> ... </build> Further InformationFor further information about the assembly plugin options, go to: |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |