bingmous

欢迎交流,不吝赐教~

导航

maven打包的jar包中的元数据中的快照版本依赖为带时间戳的

目录

    在maven-jar-plugin的配置中添加useUniqueVersions为false,再打包的jar包的元数据的依赖就是snapshot版本了

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>*.yml</exclude>
                            <exclude>*.xml</exclude>
                            <exclude>*.properties</exclude>
                            <exclude>*.json</exclude>
                            <exclude>*.txt</exclude>
                            <exclude>db/</exclude>
                            <exclude>static/</exclude>
                        </excludes>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                                <useUniqueVersions>false</useUniqueVersions>
                                <mainClass>org.example.MainApplication</mainClass>
                            </manifest>
                            <manifestEntries>
                                <Class-Path>conf/</Class-Path>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
    

    posted on 2023-02-06 15:58  Bingmous  阅读(491)  评论(0编辑  收藏  举报