zoukankan      html  css  js  c++  java
  • jar包配置文件到单独文件夹

        <build>
    <!--        <finalName>sampling</finalName>
            <resources>
                <resource>
                    <directory>src/main/resources</directory>
                    <includes>
                        <include>**/*</include>
                    </includes>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>2.5.2</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>-->
            <finalName>sampling-scxj</finalName>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <layout>ZIP</layout>
                        <includes>
                            <!-- jar中不包含其他依赖包-->
                            <include>
                                <groupId>nothing</groupId>
                                <artifactId>nothing</artifactId>
                            </include>
                        </includes>
                    </configuration>
                </plugin>
                <!--拷贝依赖到jar外面的lib目录-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy-dependency</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <!--输出目录-->
                                <outputDirectory>${project.build.directory}/libs</outputDirectory>
                                <excludeTransitive>false</excludeTransitive>
                                <stripVersion>false</stripVersion>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- 拷贝资源文件 到指定的resource目录-->
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <!-- 资源文件输出目录 -->
                                <outputDirectory>${project.build.directory}/config</outputDirectory>
                                <resources>
                                    <resource>
                                        <directory>src/main/resources</directory>
                                        <filtering>true</filtering>
                                        <!--包含的文件-->
                                        <includes>
                                            <include>*/**</include>
                                        </includes>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!--指定配置文件-->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <!-- 生成的jar中,不要包含pom.xml和pom.properties这两个文件 -->
                            <addMavenDescriptor>false</addMavenDescriptor>
                            <manifest>
                                <!-- 是否要把第三方jar加入到类构建路径 -->
                                <addClasspath>true</addClasspath>
                                <!-- 外部依赖jar包的最终位置 -->
                                <classpathPrefix>/libs/</classpathPrefix>
                                <!-- 配置项目启动类 -->
                                <mainClass>com.sean.soft.sampling.SamplingApplication</mainClass>
                            </manifest>
                            <!-- 指定配置文件的新目录-->
                            <manifestEntries>
                                <Class-Path>/config/</Class-Path>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
  • 相关阅读:
    大爽Python入门教程 45 实践使用
    大爽pyqt5笔记&教程 四 布局 Layout 对其
    大爽Python入门教程 47 答案
    大爽Python入门教程 46 习题
    大爽Python入门教程 43 函数传参 形参、实参 default、*args、**kwargs
    大爽Python入门教程 41 初识函数Function
    大爽Python入门教程 56 实践练习 功能添加
    检测密码是否能过强度检测(正则表达式检测)
    常用加密算法汇总一下
    [转]技术人员,你拿什么拯救你的生活温水煮青蛙
  • 原文地址:https://www.cnblogs.com/seanRay/p/15686989.html
Copyright © 2011-2022 走看看