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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

BIG陽 2022-05-21 21:08:45
在我pom.xml的定義中,我定義了幾個配置文件來在 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>正如您在每個新wls配置文件中看到的那樣,我需要定義依賴項以使用提供范圍(否則部署將由于某些 tomcat 資源而失?。?。但是我仍然有一些其他配置文件不會使用這wls-common部分有沒有辦法我可以定義一些wls-common配置文件,這些配置文件將在不更改我的命令的情況下從那里自動使用mvn?我知道我可以在屬性中mvn -P p1,p2或?qū)傩灾墟溄觽€人資料,-Dp1=wls但這不是我想要的。
查看完整描述

2 回答

?
ITMISS

TA貢獻(xiàn)1871條經(jīng)驗 獲得超8個贊

在您的所有配置文件中定義將激活特定配置文件并將它們?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>


查看完整回答
反對 回復(fù) 2022-05-21
?
慕桂英3389331

TA貢獻(xiàn)2036條經(jīng)驗 獲得超8個贊

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



查看完整回答
反對 回復(fù) 2022-05-21
  • 2 回答
  • 0 關(guān)注
  • 186 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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