Maven利用Java service wrapper生成Windows服务

上传者: a123demi | 上传时间: 2021-04-09 19:37:38 | 文件大小: 1.19MB | 文件类型: ZIP
在项目的开发中,有时候需要将Java应用程序打包成Windows服务,我们就直接可以通过windows的服务来启动和关闭java程序了。 本博文将通过有两种方法实现该功能,手动创建法和Maven自动打包法。

文件下载

资源详情

[{"title":"( 62 个子文件 1.19MB ) Maven利用Java service wrapper生成Windows服务","children":[{"title":"wrapper","children":[{"title":".project <span style='color:#111;'> 559B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"test","children":[{"title":"java","children":[{"title":"window_wrapper","children":[{"title":"wrapper","children":[{"title":"AppTest.java <span style='color:#111;'> 571B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"resources","children":[{"title":"config","children":[{"title":"config.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"InstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"UninstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":true},{"title":"java","children":[{"title":"window_wrapper","children":[{"title":"wrapper","children":[{"title":"App.java <span style='color:#111;'> 359B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"target","children":[{"title":"generated-test-sources","children":[{"title":"test-annotations","children":null,"spread":false}],"spread":true},{"title":"maven-status","children":[{"title":"maven-compiler-plugin","children":[{"title":"testCompile","children":[{"title":"default-testCompile","children":[{"title":"createdFiles.lst <span style='color:#111;'> 37B </span>","children":null,"spread":false},{"title":"inputFiles.lst <span style='color:#111;'> 79B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"compile","children":[{"title":"default-compile","children":[{"title":"createdFiles.lst <span style='color:#111;'> 33B </span>","children":null,"spread":false},{"title":"inputFiles.lst <span style='color:#111;'> 75B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"generated-sources","children":[{"title":"annotations","children":null,"spread":false}],"spread":true},{"title":"classes","children":[{"title":"config","children":[{"title":"config.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 115B </span>","children":null,"spread":false},{"title":"maven","children":[{"title":"window_wrapper","children":[{"title":"wrapper","children":[{"title":"pom.properties <span style='color:#111;'> 222B </span>","children":null,"spread":false},{"title":"pom.xml <span style='color:#111;'> 5.16KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"window_wrapper","children":[{"title":"wrapper","children":[{"title":"App.class <span style='color:#111;'> 982B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"InstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"UninstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":true},{"title":"surefire-reports","children":[{"title":"window_wrapper.wrapper.AppTest.txt <span style='color:#111;'> 277B </span>","children":null,"spread":false},{"title":"TEST-window_wrapper.wrapper.AppTest.xml <span style='color:#111;'> 5.90KB </span>","children":null,"spread":false}],"spread":true},{"title":"wrapper","children":[{"title":"jsw","children":[{"title":"mywrapper","children":[{"title":"conf","children":[{"title":"wrapper-mywrapper.conf <span style='color:#111;'> 3.65KB </span>","children":null,"spread":false}],"spread":true},{"title":"wrapper.log <span style='color:#111;'> 233B </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"libwrapper-macosx-universal-32.jnilib <span style='color:#111;'> 34.50KB </span>","children":null,"spread":false},{"title":"wrapper.jar <span style='color:#111;'> 81.86KB </span>","children":null,"spread":false},{"title":"libwrapper-macosx-universal-64.jnilib <span style='color:#111;'> 34.15KB </span>","children":null,"spread":false},{"title":"wrapper-windows-x86-32.dll <span style='color:#111;'> 80.00KB </span>","children":null,"spread":false},{"title":"libwrapper-linux-x86-32.so <span style='color:#111;'> 11.61KB </span>","children":null,"spread":false},{"title":"wrapper-windows-x86-64.dll <span style='color:#111;'> 75.00KB </span>","children":null,"spread":false},{"title":"libwrapper-linux-x86-64.so <span style='color:#111;'> 14.89KB </span>","children":null,"spread":false},{"title":"commons-lang-2.6.jar <span style='color:#111;'> 277.56KB </span>","children":null,"spread":false},{"title":"wrapper-0.0.1-SNAPSHOT.jar <span style='color:#111;'> 8.78KB </span>","children":null,"spread":false}],"spread":false},{"title":"etc","children":[{"title":"config","children":[{"title":"config.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"InstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"UninstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":false},{"title":"bin","children":[{"title":"wrapper-linux-x86-64 <span style='color:#111;'> 108.42KB </span>","children":null,"spread":false},{"title":"mywrapper.bat <span style='color:#111;'> 3.61KB </span>","children":null,"spread":false},{"title":"wrapper-macosx-universal-32 <span style='color:#111;'> 228.13KB </span>","children":null,"spread":false},{"title":"wrapper-windows-x86-32.exe <span style='color:#111;'> 200.00KB </span>","children":null,"spread":false},{"title":"wrapper-windows-x86-64.exe <span style='color:#111;'> 215.50KB </span>","children":null,"spread":false},{"title":"wrapper-linux-x86-32 <span style='color:#111;'> 97.07KB </span>","children":null,"spread":false},{"title":"InstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"mywrapper <span style='color:#111;'> 15.35KB </span>","children":null,"spread":false},{"title":"wrapper-macosx-universal-64 <span style='color:#111;'> 247.49KB </span>","children":null,"spread":false},{"title":"UninstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"appassembler","children":[{"title":"repo","children":[{"title":"commons-lang-2.6.jar <span style='color:#111;'> 277.56KB </span>","children":null,"spread":false},{"title":"wrapper-0.0.1-SNAPSHOT.jar <span style='color:#111;'> 8.78KB </span>","children":null,"spread":false}],"spread":true},{"title":"bin","children":[{"title":"init_app <span style='color:#111;'> 3.28KB </span>","children":null,"spread":false},{"title":"init_app.bat <span style='color:#111;'> 2.95KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"mywrapper","children":[{"title":"etc","children":[{"title":"config","children":[{"title":"config.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"InstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"UninstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"maven-archiver","children":[{"title":"pom.properties <span style='color:#111;'> 120B </span>","children":null,"spread":false}],"spread":true},{"title":"test-classes","children":[{"title":"config","children":[{"title":"config.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"window_wrapper","children":[{"title":"wrapper","children":[{"title":"AppTest.java <span style='color:#111;'> 571B </span>","children":null,"spread":false},{"title":"AppTest.class <span style='color:#111;'> 624B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"InstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false},{"title":"UninstallApp-NT.bat <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":true},{"title":"surefire","children":null,"spread":false},{"title":"wrapper-0.0.1-SNAPSHOT.jar <span style='color:#111;'> 8.78KB </span>","children":null,"spread":false}],"spread":false},{"title":".settings","children":[{"title":"org.eclipse.m2e.core.prefs <span style='color:#111;'> 90B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 243B </span>","children":null,"spread":false},{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 155B </span>","children":null,"spread":false}],"spread":true},{"title":"pom.xml <span style='color:#111;'> 5.16KB </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 1.10KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • douhaichao :
    恩。还不错。可以运行起来。
    2018-12-12
  • hoarhoar :
    可以使用,谢谢提供。
    2017-10-31
  • homers2012 :
    我以为是配置好的,只有一个源程序而己
    2015-10-24
  • wxh1850307107 :
    太棒了,解决了很大问题
    2015-07-06

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明