简体   繁体   English

Spring Maven生成两个Wars Windows和UNIX相同的应用程序

[英]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.

相关问题 无法生成 <application-name> 进入maven耳塞 - Unable to generate <application-name> entry with maven ear plugin 春季与行家 - Spring with maven 如何生成XSLT中两组元素相同的随机数? - How to generate random number which is same for two set of elements in XSLT? 自Unix时代以来生成XML日期 - Generate XML dates since the Unix Epoch 使用Maven生成HTML Checkstyle报告 - Generate html checkstyle report with maven 在Windows应用程序中读取两个xml并创建treeview控件 - To read two xmls and create treeview control in windows application 为增值时,应用程序不起作用 <context-param> Maven在Spring MVC Web应用程序中的web.xml中使用 - Application not workig when adding value to <context-param> in web.xml in Spring MVC Web Application Using Maven jaxb2-maven-plugin 在生成 xsd 时忽略命名空间 - 两个类具有相同的 XML 类型 - jaxb2-maven-plugin ignores namespace when generating xsd - Two classes have the same XML type 在同一应用程序中为两个不同的空列表视图设置2个不同的图像 - Set 2 different images for two different empty listview in the same application 当两个单独的模式具有相同的名称空间时,如何告诉JAXB在单独的程序包中生成类? - How can I tell JAXB to generate classes in separate packages when two separate schemas have the same namespace?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM