Newer
Older
casic-security-cockpit-mini / casic-server / pom.xml
wangpeng on 22 Nov 2022 6 KB 增加部署插件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.casic</groupId>
        <artifactId>casic-security-cockpit-mini</artifactId>
        <version>2.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>casic-server</artifactId>
    <version>2.0.0</version>
    <packaging>jar</packaging>
    <name>casic-server</name>
    <description>casic 的spring boot版本</description>

    <properties>
        <!--服务器项目运行的地址-->
        <service-path>/home/admin/app/wangpeng/securitycockpitmini/casic-web-2.0.0/lib/</service-path>
        <sh-path>/home/admin/app/wangpeng/securitycockpitmini/casic-web-2.0.0/deploy.sh</sh-path>
        <pack-name>${project.artifactId}-${project.version}.jar</pack-name>
        <!--ssh登录服务器的ip和端口 端口一般默认22-->
        <remote-addr>111.198.10.15:21402</remote-addr>
        <remote-username>admin</remote-username>
        <remote-passwd>Casic203</remote-passwd>
    </properties>

    <dependencies>
        <!--基础包依赖-->
        <dependency>
            <groupId>com.casic</groupId>
            <artifactId>casic-core</artifactId>
            <version>${core.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.casic</groupId>
            <artifactId>casic-admin-support</artifactId>
            <version>${admin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${boot.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.casic</groupId>
            <artifactId>casic-admin-core</artifactId>
            <version>2.0.0.alpha</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>com.dameng</groupId>
            <artifactId>DmJdbcDriver18</artifactId>
            <version>1.8</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <version>1.15.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
        </dependency>
        <!--其他-->
        <dependency>
            <groupId>com.casic</groupId>
            <artifactId>casic-file-support</artifactId>
            <version>${admin.version}</version>
            <!--            <scope>provided</scope>-->
        </dependency>
        <dependency>
            <groupId>com.casic</groupId>
            <artifactId>casic-file</artifactId>
            <version>${admin.version}</version>
            <!--            <scope>provided</scope>-->
        </dependency>
        <dependency>
            <groupId>com.casic</groupId>
            <artifactId>casic-export-support</artifactId>
            <version>${extension.version}</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.auth0</groupId>
            <artifactId>java-jwt</artifactId>
            <version>3.7.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.belerweb</groupId>
            <artifactId>pinyin4j</artifactId>
            <version>2.5.0</version>
        </dependency>
        <!--自动化部署-->
        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>wagon-maven-plugin</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh</artifactId>
                <version>2.8</version>
            </extension>
        </extensions>
        <!--自动化部署配置-->
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>wagon-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <fromFile>target/${pack-name}</fromFile>
                    <url><![CDATA[scp://${remote-username}:${remote-passwd}@${remote-addr}${service-path}]]></url>
                    <!-- 在服务器执行的命令集合 -->
                    <commands>
                        <!--                        &lt;!&ndash; 杀死原来的jar进程 &ndash;&gt;-->
                        <!--                        <command>pkill -f ${pack-name}</command>-->
                        <!--                        &lt;!&ndash; 重新启动jar进程,程序的输出结果写到log文件中 &ndash;&gt;-->
                        <!--                        <command><![CDATA[nohup java -jar ${service-path}/${pack-name} > /dev/null 2>&1 & ]]></command>-->
                        <!--                        &lt;!&ndash; netstat -nptl 可返回进程名字&ndash;&gt;-->
                        <!--                        <command><![CDATA[netstat -nptl]]></command>-->
                        <!--                        <command><![CDATA[ps -ef | grep java | grep -v grep]]></command>-->
                        <command>sh ${sh-path}</command>
                    </commands>
                    <!-- 显示运行命令的输出结果 -->
                    <displayCommandOutputs>true</displayCommandOutputs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>