<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
<configuration>
<configurationDirectory>conf</configurationDirectory>
<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
<copyConfigurationDirectory>true</copyConfigurationDirectory>
<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
<assembleDirectory>${project.build.directory}/client</assembleDirectory>
<extraJvmArguments>-Xms128m</extraJvmArguments>
<binFileExtensions>
<unix>.sh</unix>
</binFileExtensions>
<platforms>
<platform>windows</platform>
<platform>unix</platform>
</platforms>
<repositoryName>lib</repositoryName>
<programs>
<program>
<mainClass>com.nfs.iot.sas.scheduling.TriggerRunner</mainClass>
<name>start</name>
</program>
</programs>
</configuration>
</plugin>
</plugins>
</build>
用了一个maven的appassembler-maven-plugin插件 这里特别注意的是目前这个插件不能将配置文件删除,如果你有一些配置文件需要在config下就行配置,但是又不想将resources里的conf打到jar里现在没有办法,即使你配置config里的配置信息也不能有效的执行,应为jar中有这些配置信息,jar运行时还会读取jar中的配置信息.