简体   繁体   English

Maven build 2个版本的war,不同版本的依赖

[英]Maven build 2 versions of war with different versions of dependencies

I have a maven war project which needs to be build with different versions of a dependency due to target environments.我有一个 maven 战争项目,由于目标环境,该项目需要使用不同版本的依赖项进行构建。

Currently I am doing it with maven profiles(having different versions of dependency as property).目前我正在使用 maven 配置文件(具有不同版本的依赖项作为属性)。

Below are the issues currently having:以下是目前遇到的问题:

  1. I need to run build with different profiles twice我需要使用不同的配置文件运行两次构建
  2. Not sure how change war version for maven repo deploy不确定如何更改 maven 存储库部署的战争版本
    for ex: 1.0.0-parallel, 1.0.0-prod where pom.xml has 1.0.0例如:1.0.0-parallel, 1.0.0-prod 其中 pom.xml 有 1.0.0

I saw below solution but it needs to create separate modules: EAR with WARs containing different versions of dependencies我看到了下面的解决方案,但它需要创建单独的模块: EAR with WARs contains different versions of dependencies

Create a multi-module project that contains two WAR modules and an additional commons module that contains all the common code.创建一个包含两个 WAR 模块和一个包含所有公共代码的附加commons模块的多模块项目。

This allows you to create two very similar WARs in one build.这允许您在一个构建中创建两个非常相似的 WAR。

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

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