我通过使用maven-dependency-plugin来复制解析的pom依赖关系和其他jar,从而找到了解决方案。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<includeScope>runtime</includeScope>
</configuration>
</execution>
<execution>
<id>copy-model</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>my.test.pkg</groupId>
<artifactId>my-model</artifactId>
<classifier>server</classifier>
<version>1.0.3</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>my.test.pkg</groupId>
<artifactId>my-model</artifactId>
<classifier>server</classifier>
<version>1.1.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
现在,我只需要在我的程序集xml中添加以下行
<fileSet>
<directory>${project.build.directory}/lib</directory>
<outputDirectory>/lib</outputDirectory>
<filtered>false</filtered>
<includes>
<include>*.jar</include>
</includes>
<fileMode>0600</fileMode>
</fileSet>