第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何提取 Maven 配置文件中的公共部分

如何提取 Maven 配置文件中的公共部分

偶然的你 2022-05-21 21:08:17
在我pom.xml的定義中,我定義了幾個(gè)配置文件來(lái)在 Oracle WebLogic 下運(yùn)行我的 Spring Boot 應(yīng)用程序:    <profile>        <id>wls-1</id>        <dependencies>            <dependency>                <groupId>org.springframework.boot</groupId>                <artifactId>spring-boot-starter-tomcat</artifactId>                <scope>provided</scope>            </dependency>        </dependencies>        <properties>        </properties>    </profile>    <profile>        <id>wls-2</id>        <dependencies>            <dependency>                <groupId>org.springframework.boot</groupId>                <artifactId>spring-boot-starter-tomcat</artifactId>                <scope>provided</scope>            </dependency>        </dependencies>        <properties>        </properties>    </profile>    <profile>        <id>wls-3</id>        <dependencies>            <dependency>                <groupId>org.springframework.boot</groupId>                <artifactId>spring-boot-starter-tomcat</artifactId>                <scope>provided</scope>            </dependency>        </dependencies>        <properties>        </properties>    </profile>    <profile>        <id>tomcat1</id>        <properties>        </properties>    </profile>正如您在每個(gè)新wls配置文件中看到的那樣,我需要定義依賴項(xiàng)以使用提供范圍(否則部署將由于某些 tomcat 資源而失敗)。但是我仍然有一些其他配置文件不會(huì)使用這wls-common部分有沒(méi)有辦法我可以定義一些wls-common配置文件,這些配置文件將在不更改我的命令的情況下從那里自動(dòng)使用mvn?我知道我可以在屬性中mvn -P p1,p2或?qū)傩灾墟溄觽€(gè)人資料,-Dp1=wls但這不是我想要的。
查看完整描述

2 回答

?
犯罪嫌疑人X

TA貢獻(xiàn)2080條經(jīng)驗(yàn) 獲得超4個(gè)贊

在您的所有配置文件中定義將激活特定配置文件并將它們?nèi)糠旁谕ㄓ门渲梦募械膶傩浴?/p>


但是,這將要求您將命令從更改mvn -Pwls-1為mvn -Dwls-1


<profile>

 <id>wls-1</id>

 <activation>

   <property>

     <name>wls-1</name>

   </property>

 </activation>

 ...

</profile> 

<profile>

    <id>common</id>

    <activation>

      <property>

        <name>wls-1</name>

        <name>wls-2</name>

        <name>wls-3</name>

      </property>

    </activation>

    <dependencies>

        <dependency>

            <groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-starter-tomcat</artifactId>

            <scope>provided</scope>

        </dependency>

    </dependencies>

    <properties>

    </properties>

</profile>


查看完整回答
反對(duì) 回復(fù) 2022-05-21
?
12345678_0001

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊

您不能從另一個(gè)配置文件激活配置文件。您只能通過(guò)命令行、標(biāo)記文件、操作系統(tǒng)等外部方式激活它們。



查看完整回答
反對(duì) 回復(fù) 2022-05-21
  • 2 回答
  • 0 關(guān)注
  • 145 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)