[英]Spring Maven generate two wars windows and unix same application
I have application context like this is for windows 我有这样的应用程序上下文适用于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>
and for unix should be the same just instead of C:
there is opt
. 并且对于unix,应该相同,只是代替
C:
有opt
。
My goal is on 我的目标是
"mvn -clean package"
“ MVN-清洁包”
two war files to be generated, example myapp-windows.war and myapp-linux.war. 将生成两个war文件,例如myapp-windows.war和myapp-linux.war。
myapp-windows.war should have the windows application context with C:/test. myapp-windows.war应该具有带有C:/ test的Windows应用程序上下文。
myapp-unix.war should have the unix applicationContext with opt/test/. myapp-unix.war应该具有opt / test /的unix applicationContext。
How should i set up applicationContext to make this work. 我应该如何设置applicationContext来使其工作。
I am not sure if this is helpful to you but I guess, you can use profiler to do this. 我不确定这是否对您有帮助,但是我想您可以使用探查器来做到这一点。 It will not generate the both war at the same time but you can configure the setting based on OS family and will generate the war based on which OS you are running.
它不会同时产生两个战争,但您可以根据OS系列配置设置,并根据您正在运行的OS产生战争。
<profile>
<id>platform-windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
...
</plugins>
</build>
</profile>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.