Kaynağa Gözat

默认注释掉rpm plugin

heavyrian2012 2 yıl önce
ebeveyn
işleme
f34a732b6a
2 değiştirilmiş dosya ile 77 ekleme ve 78 silme
  1. 5 3
      README.md
  2. 72 75
      pom.xml

+ 5 - 3
README.md

@@ -29,13 +29,15 @@
 > 本工程为Demo工程,实际使用时需要把对应功能移植到您的应用服务中。如果需要直接使用,请按照后面的说明解决掉性能瓶颈问题。
 
 #### 编译
-由于```pom.xml```中使用了生成RPM包的plugin,所以需要本地安装有rpm。如果不需要RPM包,可以删除掉```pom.xml```文件中的RPM plugin。
-
-在安装RPM后或者删除```pom.xml```文件中的RPM plugin后,执行下面命令:
 ```
 mvn clean package
 ```
 
+## 打包RPM格式
+打包会生成Java包和deb安装包,如果需要rpm安装包,请在```pom.xml```中取消注释生成rpm包的plugin。另外还需要本地安装有rpm,在linux或者mac系统中很容易安装,在windows系统需要安装cygwin并安装rpm,具体信息请百度查询。
+
+修改之后运行编译命令```mvn clean package```,rpm包生成在```target```目录下。
+
 #### 短信资源
 应用使用的是腾讯云短信功能,需要申请到```appid/appkey/templateId```这三个参数,并配置到```tencent_sms.properties```中去。用户也可以自行更换为自己喜欢的短信提供商。在没有短信供应商的情况下,为了测试可以使用```superCode```,设置好后,客户端可以直接使用```superCode```进行登陆。上线时一定要注意删掉```superCode```。
 

+ 72 - 75
pom.xml

@@ -280,81 +280,78 @@
 			</plugin>
 
 			<!--        RPM Plugin 开始-->
-			<!--        打包RPM 包需要本地有rpm命令才可以,linux和mac都可以安装rpm。如果是windows需要cygwin安装rpm才可以,如果不需要rpm包,可以把这个plugin注释掉-->
-			<plugin>
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>rpm-maven-plugin</artifactId>
-				<version>2.2.0</version>
-				<executions>
-					<execution>
-						<id>generate-rpm</id>
-						<goals>
-							<goal>rpm</goal>
-						</goals>
-					</execution>
-				</executions>
-
-				<configuration>
-					<group>Applications/Chat</group>
-					<name>app-server</name>
-					<needarch>noarch</needarch>
-					<targetOS>linux</targetOS>
-					<prefix>/opt/app-server</prefix>
-					<defineStatements>
-						<defineStatement>_unpackaged_files_terminate_build 0</defineStatement>
-					</defineStatements>
-					<copyTo>
-						target/app-server-${project.version}.rpm
-					</copyTo>
-					<requires>
-						<require>java-1.8.0-openjdk-headless</require>
-					</requires>
-
-					<mappings>
-						<mapping>
-							<directory>/opt/app-server</directory>
-							<filemode>755</filemode>
-							<sources>
-								<source>
-									<location>${project.build.directory}/${project.name}-${project.version}.jar</location>
-								</source>
-							</sources>
-						</mapping>
-						<mapping>
-							<directory>/opt/app-server/config</directory>
-							<filemode>755</filemode>
-							<sources>
-								<source>
-									<location>${project.basedir}/config</location>
-								</source>
-							</sources>
-						</mapping>
-
-						<mapping>
-							<directory>/usr/lib/systemd/system</directory>
-							<filemode>644</filemode>
-							<username>root</username>
-							<groupname>root</groupname>
-							<directoryIncluded>false</directoryIncluded>
-							<sources>
-								<source>
-									<location>${project.basedir}/systemd/app-server.service</location>
-								</source>
-							</sources>
-						</mapping>
-					</mappings>
-					<postinstallScriptlet>
-						<script>
-							mv -f /opt/app-server/app-*.jar /opt/app-server/app-server.jar ; echo "Im server installed in /opt/app-server" ; systemctl daemon-reload
-						</script>
-					</postinstallScriptlet>
-					<postremoveScriptlet>
-						<script>
-							echo "Remove files..." ; cd /opt/app-server ; rm -rf * ; rm -rf /usr/lib/systemd/system/app-server.service ; systemctl daemon-reload
-						</script>
-					</postremoveScriptlet>
-				</configuration>
-			</plugin>
+			<!--        打包RPM 包需要本地有rpm命令才可以,linux和mac都可以安装rpm。如果是windows需要cygwin安装rpm才可以,如果需要rpm包,可以把这个plugin取消注释-->
+<!--			<plugin>-->
+<!--				<groupId>org.codehaus.mojo</groupId>-->
+<!--				<artifactId>rpm-maven-plugin</artifactId>-->
+<!--				<version>2.2.0</version>-->
+<!--				<executions>-->
+<!--					<execution>-->
+<!--						<id>generate-rpm</id>-->
+<!--						<goals>-->
+<!--							<goal>rpm</goal>-->
+<!--						</goals>-->
+<!--					</execution>-->
+<!--				</executions>-->
+<!--				<configuration>-->
+<!--					<group>Applications/Chat</group>-->
+<!--					<name>app-server</name>-->
+<!--					<needarch>noarch</needarch>-->
+<!--					<targetOS>linux</targetOS>-->
+<!--					<prefix>/opt/app-server</prefix>-->
+<!--					<defineStatements>-->
+<!--						<defineStatement>_unpackaged_files_terminate_build 0</defineStatement>-->
+<!--					</defineStatements>-->
+<!--					<copyTo>-->
+<!--						target/app-server-${project.version}.rpm-->
+<!--					</copyTo>-->
+<!--					<requires>-->
+<!--						<require>java-1.8.0-openjdk-headless</require>-->
+<!--					</requires>-->
+<!--					<mappings>-->
+<!--						<mapping>-->
+<!--							<directory>/opt/app-server</directory>-->
+<!--							<filemode>755</filemode>-->
+<!--							<sources>-->
+<!--								<source>-->
+<!--									<location>${project.build.directory}/${project.name}-${project.version}.jar</location>-->
+<!--								</source>-->
+<!--							</sources>-->
+<!--						</mapping>-->
+<!--						<mapping>-->
+<!--							<directory>/opt/app-server/config</directory>-->
+<!--							<filemode>755</filemode>-->
+<!--							<sources>-->
+<!--								<source>-->
+<!--									<location>${project.basedir}/config</location>-->
+<!--								</source>-->
+<!--							</sources>-->
+<!--						</mapping>-->
+<!--						<mapping>-->
+<!--							<directory>/usr/lib/systemd/system</directory>-->
+<!--							<filemode>644</filemode>-->
+<!--							<username>root</username>-->
+<!--							<groupname>root</groupname>-->
+<!--							<directoryIncluded>false</directoryIncluded>-->
+<!--							<sources>-->
+<!--								<source>-->
+<!--									<location>${project.basedir}/systemd/app-server.service</location>-->
+<!--								</source>-->
+<!--							</sources>-->
+<!--						</mapping>-->
+<!--					</mappings>-->
+<!--					<postinstallScriptlet>-->
+<!--						<script>-->
+<!--							mv -f /opt/app-server/app-*.jar /opt/app-server/app-server.jar ; echo "Im server installed in /opt/app-server" ; systemctl daemon-reload-->
+<!--						</script>-->
+<!--					</postinstallScriptlet>-->
+<!--					<postremoveScriptlet>-->
+<!--						<script>-->
+<!--							echo "Remove files..." ; cd /opt/app-server ; rm -rf * ; rm -rf /usr/lib/systemd/system/app-server.service ; systemctl daemon-reload-->
+<!--						</script>-->
+<!--					</postremoveScriptlet>-->
+<!--				</configuration>-->
+<!--			</plugin>-->
 			<!--            RPM Plugin 结束-->
 
 		</plugins>