简体   繁体   English

Maven大战并将版本号放在WEB-INF / lib中的jar中

[英]Maven war and put the version number in the jars in WEB-INF/lib

If I have a war configuration which builds a standard war file with a WEB-INF/lib directory. 如果我有一个war配置,可以使用WEB-INF / lib目录构建一个标准war文件。 The jar files come out as spring-core.jar. jar文件以spring-core.jar的形式出现。 Is it possible to include the version number that are listed in the dependency list, eg I want to have a war with version numbers, 是否可以包括依赖性列表中列出的版本号,例如我想与版本号打架,

WEB-INF/lib/spring-4.3.8.RElEASE.jar WEB-INF / LIB /弹簧4.3.8.RElEASE.jar

Instead of: 代替:

WEB-INF/lib/spring.jar WEB-INF / lib中/的spring.jar

 <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <outputFileNameMapping>@{artifactId}@.@{extension}@</outputFileNameMapping>
                    <webResources>
                        <resource>
                            <directory>WebContent</directory>
                        </resource>
                    </webResources>
                </configuration>
            </plugin> 

The default name is whatever it's called in the repository. 默认名称是在存储库中调用的名称。 You may have a configuration overriding this feature (such as stripVersion from the maven-dependency-plugin). 您可能具有覆盖此功能的配置(例如,来自maven-dependency-plugin的stripVersion)。

This question describes the process of renaming a single dependency: Renaming Maven dependency in WAR's WEB-INF/lib folder . 这个问题描述了重命名单个依赖项的过程: 重命名WAR的WEB-INF / lib文件夹中的Maven依赖项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM