gpt4 book ai didi

xml - Spring Maven 生成两个 wars windows 和 unix 相同的应用程序

转载 作者:行者123 更新时间:2023-11-28 22:49:21 25 4
gpt4 key购买 nike

我有像这样的适用于 Windows 的应用程序上下文

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">

<import resource="file:C:/test/applicationContext.xml" />
</beans>

对于 unix 应该是相同的,只是 C:opt

我的目标是

"mvn -clean package"

要生成两个 war 文件,例如 myapp-windows.war 和 myapp-linux.war。

myapp-windows.war 应该有带有 C:/test 的 windows 应用程序上下文。

myapp-unix.war 应该有带有 opt/test/的 unix applicationContext。

我应该如何设置 applicationContext 才能使其正常工作。

最佳答案

我不确定这是否对您有帮助,但我想您可以使用 profiler去做这个。它不会同时生成两个 war ,但您可以根据操作系统系列配置设置,并将根据您运行的操作系统生成 war 。

<profile>
<id>platform-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
...
</plugins>
</build>
</profile>

关于xml - Spring Maven 生成两个 wars windows 和 unix 相同的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45815356/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com