Nate covered this for the most part, but I'll give concrete examples.
Here's how your directory layout should look like:
pom.xml
src/main/assembly/assembly.xml
core/pom.xml
core/src/main/java/...
core/src/test/java/...
examples/pom.xml
examples/src/main/java/...
In the base pom, you'll denote your submodules as follows:
<modules>
<modules>core</modules>
<modules>examples</modules>
</modules>
Assuming your base groupId is "com.company.example" and your artifactId is "xy", then your module poms will begin with the following (adjusting for names and versions, of course):
<parent>
<groupId>com.company.example</groupId>
<artifactId>xy</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.company.example</groupId>
<artifactId>xy-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
To make sure the assembly runs in the base project, include the following in your build configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
Also, to build a separate jar for the test classes, add this to the core/pom.xml file:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
The assembly.xml itself will look like this:
<assembly>
<id>assembly</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<binaries>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
<outputDirectory>lib</outputDirectory>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
I'm probably missing a few things here but that's the general idea.