zoukankan      html  css  js  c++  java
  • java server wrapper 和 maven assembly 插件

    Java Service Wrapper工具YAJSW 简介信息

    YAJSW是一个开源的Java服务包装(Java Service Wrapper)工具。YAJSW允许您把任何应用程序安装为window的服务或者作为一个Linux posix的守护进程进行监控。可以通过JNLP文件读取配置信息,也可以从远程包装配置信息文件中读取配置信息。通过使用VFS虚拟文件系统(Virtual File System),YAJSW支持多种传输协议,例如:HTTP,HTTPS,FTP,SFTP,SMTP,WEBDAV,这些功能对于Java web Start来说是望尘莫及的,以为内它仅仅支持http.
    一些重要的特性:

    支持JNLP配置文件,并且通过网络远程加载它。
    支持包装任何本机可以执行的Java进程或者groovy脚本成为一个window服务或者linux守护进程
    支持夸平台安装服务和守护进程
    支持跨平台参数配置
    支持针对某个平台特定的配置信息
    原生支持classpath目录和文件
    支持捕获控制台输出,并记录成日志。并且可以再输入日志符合某些特定的正则表达式的时候出发一段可以执行脚本(YAJSW的这个功能很强大啊,可以用于自动监控)
    支持监控应用自动重启和服务崩溃处理
    支持在特定的时间周期,或者脚本执行的条件下 执行或者终止进程
    支持在Java应用程序内部嵌入包装
    支持从进程中读取输出,同时也可以向进程中写入
    支持“RunAs和Sudo”
    支持系统托盘图标,YAJSW可以通过一段groovy脚本发送托盘信息。这在控制台监控中用于捕获并提示异常信息非常有帮助。
    支持生成配置文件
    支持windows集群通知
    支持远程网络启动

    <build>
    	<plugins>
    		<plugin>
    	        <groupId>org.apache.maven.plugins</groupId>
    	        <artifactId>maven-jar-plugin</artifactId>
    	        <configuration>
    				<excludes>
    					<exclude>**/*.properties</exclude>
    				</excludes>
    			</configuration>
            </plugin>
            <plugin>
    			<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
    			<artifactId>maven-svn-revision-number-plugin</artifactId>
    			<version>1.7</version>
    			<configuration>
    				<verbose>true</verbose>
    				<entries>
    					<entry>
    						<prefix>prefix</prefix>
    						<depth>empty</depth>
    					</entry>
    				</entries>
    			</configuration>
    			<executions>
    				<execution>
    					<phase>validate</phase>
    					<goals>
    						<goal>revision</goal>
    					</goals>
    				</execution>
    			</executions>
    			<dependencies>
    				<dependency>
    					<groupId>org.tmatesoft.svnkit</groupId>
    					<artifactId>svnkit</artifactId>
    					<version>1.8.5</version>
    				</dependency>
    			</dependencies>
    		</plugin>
    		<plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-resources-plugin</artifactId>  
                <configuration>  
                    <encoding>UTF-8</encoding>  
                </configuration>  
            </plugin>  
            <plugin>
    			<groupId>org.apache.maven.plugins</groupId>
    			<artifactId>maven-assembly-plugin</artifactId>
    			<configuration>
    				<appendAssemblyId>false</appendAssemblyId>
    				<finalName>${assembly.project.name}_${assembly.project.version}_svn${prefix.committedRevision}_${maven.build.timestamp}_w</finalName>
    				<archive>
    					<manifest>
    						<mainClass>com.hikvision.ga.xmap.web.XmapApplication</mainClass>
    					</manifest>
    				</archive>
    				<descriptors>
    					<descriptor>src/assembly/assembly.xml</descriptor>
    				</descriptors>
    			</configuration>
    			<executions>
    				<execution>
    					<id>make-assembly</id>
    					<phase>package</phase>
    					<goals>
    						<goal>single</goal>
    					</goals>
    				</execution>
    			</executions>
    		</plugin>
    	</plugins>
    	<pluginManagement>
    		<plugins>
    			<!--This plugin's configuration is used to store Eclipse m2e settings 
    				only. It has no influence on the Maven build itself. -->
    			<plugin>
    				<groupId>org.eclipse.m2e</groupId>
    				<artifactId>lifecycle-mapping</artifactId>
    				<version>1.0.0</version>
    				<configuration>
    					<lifecycleMappingMetadata>
    						<pluginExecutions>
    							<pluginExecution>
    								<pluginExecutionFilter>
    									<groupId>
    										com.google.code.maven-svn-revision-number-plugin
    									</groupId>
    									<artifactId>
    										maven-svn-revision-number-plugin
    									</artifactId>
    									<versionRange>
    										[1.7,)
    									</versionRange>
    									<goals>
    										<goal>revision</goal>
    									</goals>
    								</pluginExecutionFilter>
    								<action>
    									<ignore />
    								</action>
    							</pluginExecution>
    						</pluginExecutions>
    					</lifecycleMappingMetadata>
    				</configuration>
    			</plugin>
    		</plugins>
    	</pluginManagement>
    </build>
    

    参考 http://blog.csdn.net/masson32/article/details/51802732

  • 相关阅读:
    微软职位内部推荐-Senior Software Engineer
    微软职位内部推荐-Senior Software Engineer
    微软职位内部推荐-Software Development Engineer
    微软职位内部推荐-Senior Dev Lead
    微软职位内部推荐-Software Engineer II_HPC
    微软职位内部推荐-Senior Software Engineer
    微软职位内部推荐-Senior SW Engineer for Application Ecosystem
    微软职位内部推荐-Senior Software Engineer-Eco
    微软职位内部推荐-Software Development Engineer II
    微软职位内部推荐-Senior Software Lead-Index Gen
  • 原文地址:https://www.cnblogs.com/liuroy/p/7372510.html
Copyright © 2011-2022 走看看