使用appassembler-maven-plugin插件打包后,执行,使用idea直接运行是正常的,是打包配置出错了吗?@理工男海哥 显示空指针异常,如下:
yangyaos-MBP:bin yangyao$ ./component-system log4j:WARN No appenders could be found for logger (com.jfinal.kit.LogKit). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
| || \ / \ / \ | | |__ || o )| || || | | || || O || O ||| || / | || O || || | | |
\ ` || || || | | |
__||_| _/ _/ |__|
JbootConfig {version='1.6.3', mode='dev', bannerEnable=true, bannerFile='banner.txt', jfinalConfig='io.jboot.web.JbootAppConfig'} JbootServerConfig {type='${jboot.server.type}', host='${jboot.server.host}', port=8080, contextPath='${jboot.server.contextPath}'} JbootWebConfig {actionCacheEnable=true, actionCacheKeyGeneratorType='default', websocketEnable=false, websocketBufferPoolSize=100, cookieEncryptKey='JBOOT_DEFAULT_ENCRYPT_KEY'} Exception in thread "main" java.lang.NullPointerException at io.jboot.Jboot.startServer(Jboot.java:168) at io.jboot.Jboot.start(Jboot.java:149) at io.jboot.Jboot.run(Jboot.java:92) at com.jzdoctor.component.system.Application.main(Application.java:55) yangyaos-MBP:bin yangyao$
不知道是我的打包配置不对吗?附上我的打包插件配置
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>appassembler-maven-plugin</artifactId> <version>1.10</version> <configuration> <encoding>UTF-8</encoding> <!-- 生成的应用目录 --> <assembleDirectory>${project.build.directory}/app</assembleDirectory> <!-- 输出的依赖包目录,基于assembleDirectory --> <repositoryName>lib</repositoryName> <!-- lib目录中jar的存放规则,默认是${groupId}/${artifactId}的目录格式,flat表示直接把jar放到lib目录 --> <repositoryLayout>flat</repositoryLayout> <!-- 生成的执行文件目录,基于assembleDirectory --> <binFolder>bin</binFolder> <!-- 生成的配置文件的目标目录的名称,基于assembleDirectory --> <configurationDirectory>configs</configurationDirectory> <!-- 应用程序配置文件目录 --> <configurationSourceDirectory>${project.basedir}/src/main/resources/</configurationSourceDirectory>
<!-- 是否复制configurationSourceDirectory下的配置文件到configurationDirectory -->
<copyConfigurationDirectory>true</copyConfigurationDirectory>
<!-- 应用console日志输出目录,基于assembleDirectory -->
<logsDirectory>logs</logsDirectory>
<!-- 应用产生的临时文件目录,基于assembleDirectory -->
<tempDirectory>temp</tempDirectory>
<!-- 生成的应用程序配置 mvn package appassembler:assemble -->
<programs>
<program>
<id>component-system</id>
<!-- 程序入口 -->
<mainClass>com.jzdoctor.component.system.Application</mainClass>
<!-- 生成的应用程序平台,支持unix,windows,all -->
<platforms>
<platform>unix</platform>
<platform>windows</platform>
</platforms>
</program>
</programs>
<!-- 生成的后台运行的应用配置 mvn clean package appassembler:generate-daemons -->
<daemons>
<daemon>
<id>component-system</id>
<!-- 程序入口 -->
<mainClass>com.jzdoctor.component.system.Application</mainClass>
<platforms>
<platform>jsw</platform>
</platforms>
<!-- 包含的平台-->
<includes>
<include>linux-x86-32</include>
<include>linux-x86-64</include>
<include>windows-x86-32</include>
<include>windows-x86-64</include>
<include>macosx-universal-32</include>
<include>macosx-universal-64</include>
</includes>
<!-- 配置信息,参考http://www.mojohaus.org/appassembler/appassembler-maven-plugin/usage-daemon-generatorconfig.html -->
<configuration>
<property>
<name>configuration.directory.in.classpath.first</name>
<value>configs</value>
</property>
<property>
<name>wrapper.ping.timeout</name>
<value>120</value>
</property>
<property>
<name>set.default.REPO_DIR</name>
<value>lib</value>
</property>
<property>
<name>wrapper.logfile</name>
<value>logs/wrapper.log</value>
</property>
</configuration>
<!-- jvm设置 http://www.mojohaus.org/appassembler/appassembler-maven-plugin/usage-daemon-jvmsettings.html-->
<!--<jvmSettings></jvmSettings>-->
</daemon>
</daemons>
</configuration>
</plugin></code></pre>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。