xuhy
2024-06-05 54692d7e35f0b70e00ac891046ff0d80115a537b
后台
2个文件已修改
86 ■■■■ 已修改文件
ManagementNTTravel/guns-admin/pom.xml 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/GunsApplication.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ManagementNTTravel/guns-admin/pom.xml
@@ -13,7 +13,7 @@
        <version>1.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <packaging>war</packaging>
    <packaging>jar</packaging>
    <dependencies>
        <!--<dependency>
@@ -216,47 +216,47 @@
    <build>
        <!--<plugins>-->
            <!--<plugin>-->
                <!--<groupId>org.springframework.boot</groupId>-->
                <!--<artifactId>spring-boot-maven-plugin</artifactId>-->
                <!--<configuration>-->
                    <!--<fork>true</fork>&lt;!&ndash; 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart &ndash;&gt;-->
                <!--</configuration>-->
            <!--</plugin>-->
            <!--<plugin>-->
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <!--<artifactId>maven-surefire-plugin</artifactId>-->
                <!--<configuration>-->
                     <!--<skip>true</skip>-->
                <!--</configuration>-->
            <!--</plugin>-->
        <!--</plugins>-->
        <!--打包war包引入本地jar的打包方式-->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 -->
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <!--打包后的项目名-->
                    <!--<warName>example</warName>-->
                    <!--<webResources>-->
                        <!--<resource>-->
                            <!--&lt;!&ndash;把本地lib里面的jar复制到lib&ndash;&gt;-->
                            <!--<directory>${project.basedir}/lib</directory>-->
                            <!--<targetPath>WEB-INF/lib/</targetPath>-->
                            <!--<includes>-->
                                <!--<include>**/*.jar</include>-->
                            <!--</includes>-->
                        <!--</resource>-->
                    <!--</webResources>-->
                    <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                     <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
        <!--打包war包引入本地jar的打包方式-->
<!--        <plugins>-->
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-war-plugin</artifactId>-->
<!--                <configuration>-->
<!--                    &lt;!&ndash; 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 &ndash;&gt;-->
<!--                    <failOnMissingWebXml>false</failOnMissingWebXml>-->
<!--                    &lt;!&ndash;打包后的项目名&ndash;&gt;-->
<!--                    &lt;!&ndash;<warName>example</warName>&ndash;&gt;-->
<!--                    &lt;!&ndash;<webResources>&ndash;&gt;-->
<!--                        &lt;!&ndash;<resource>&ndash;&gt;-->
<!--                            &lt;!&ndash;&lt;!&ndash;把本地lib里面的jar复制到lib&ndash;&gt;&ndash;&gt;-->
<!--                            &lt;!&ndash;<directory>${project.basedir}/lib</directory>&ndash;&gt;-->
<!--                            &lt;!&ndash;<targetPath>WEB-INF/lib/</targetPath>&ndash;&gt;-->
<!--                            &lt;!&ndash;<includes>&ndash;&gt;-->
<!--                                &lt;!&ndash;<include>**/*.jar</include>&ndash;&gt;-->
<!--                            &lt;!&ndash;</includes>&ndash;&gt;-->
<!--                        &lt;!&ndash;</resource>&ndash;&gt;-->
<!--                    &lt;!&ndash;</webResources>&ndash;&gt;-->
<!--                </configuration>-->
<!--            </plugin>-->
<!--        </plugins>-->
        <resources>
            <resource>
                <directory>lib</directory>
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/GunsApplication.java
@@ -35,14 +35,14 @@
    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(GunsApplication.class, args);
        Environment env = applicationContext.getEnvironment();
        logger.info("GunsApplication is success!");
        logger.info("\n----------------------------------------------------------\n\t" +
                        "应用 '{}' 运行成功! 访问连接:\n\t" +
                        "Swagger文档: \t\thttp://{}:{}\n" +
                        "----------------------------------------------------------",
                env.getProperty("spring.application.name", "后台管理"),
                InetAddress.getLocalHost().getHostAddress(),
                env.getProperty("server.port", "8010"));
        System.out.println("GunsApplication is success!");
//        logger.info("\n----------------------------------------------------------\n\t" +
//                        "应用 '{}' 运行成功! 访问连接:\n\t" +
//                        "Swagger文档: \t\thttp://{}:{}\n" +
//                        "----------------------------------------------------------",
//                env.getProperty("spring.application.name", "后台管理"),
//                InetAddress.getLocalHost().getHostAddress(),
//                env.getProperty("server.port", "8010"));
    }
    @Bean //通过ip地址调用