首页 > 解决方案 > 耳朵依赖概况

问题描述

我正在尝试将 EAR 部署到 JBOSS。ear 中有很多依赖项。其中之一是核心 java 项目,我们假设名称为“CORE” Spring 核心库被包含在 CORE 中,CORE 编译 java 1.7

我在核心项目中声明了 2 个配置文件定义。默认一个名称是 compile17 另一个名称是 compile18

核心.pom

<profiles>
    <profile>
        <id>compile17</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>       
        <properties>
            <java.source>1.7</java.source>
            <java.target>1.7</java.target>
            <springframework.version>4.3.14.RELEASE</springframework.version>
        </properties>
    </profile>
    <profile>
        <id>compile18</id>
        <properties>
            <java.source>1.8</java.source>
            <java.target>1.8</java.target>
            <springframework.version>4.3.25.RELEASE</springframework.version>
        </properties>
    </profile>
</profiles>

EAR.pom

    <dependency>
        <groupId>com.example.core</groupId>
        <artifactId>CORE</artifactId>
        <version>0.1.2-SNAPSHOT</version>
    </dependency>

我的问题如下,当我获得ear文件jboss a deploy时,如何在core.pom文件中将配置文件设置为活动配置文件。当我启动openshift管道进行部署时,部署了Ear。我有两个不同的平台所以我需要根据合适的平台选择CORE

标签: javaspringmavenpom.xmlear

解决方案


推荐阅读