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

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

如何將 .properties 文件從父項目共享到子項目

如何將 .properties 文件從父項目共享到子項目

慕森卡 2023-05-24 14:54:31
我有一個帶有 .properties 文件的父項目,該文件根據(jù)項目上定義的配置文件進行過濾,該項目有子項目或模塊,我希望過濾后的 .properties 文件可用于子項目,我可以使用 java 中的 resourceBoundle 或其他任何方式訪問文件的屬性。我嘗試使用,沒有運氣 如何在 Maven2 模塊之間共享過濾器文件?-> MojoHaus 項目父母pom<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">    <modelVersion>4.0.0</modelVersion>    <groupId>com.data</groupId>    <artifactId>data2</artifactId>    <version>data-SNAPSHOT</version>    <packaging>pom</packaging>    <name>dataNameapp</name>    <modules>        <module>child  1</module>        <module>child  2</module>        </modules>.....</project>兒童項目reference parent properties in pom some code In guess使用 java 代碼child1/test.javaResourceBundle resourceBundleProperties= ResourceBundle.getBundle("parentproperties")更新在 mi 父項目中,extras 中的這個文件被過濾了,當我通過它時,我希望它更新其他內(nèi)部文件屬性parent--extras/filtered.properties (file filtered)   child   --filters/filtered.properties (get from parent)     --resources/final.properties  (filtered of filtered.properties)
查看完整描述

1 回答

?
aluckdog

TA貢獻1847條經(jīng)驗 獲得超7個贊

您可以嘗試使用 Maven 的資源插件從父項目復制文件,例如:

? ? <project>

? ? ? ...

? ? ? <build>

? ? ? ? <plugins>

? ? ? ? ? <plugin>

? ? ? ? ? ? <artifactId>maven-resources-plugin</artifactId>

? ? ? ? ? ? <version>3.1.0</version>

? ? ? ? ? ? <executions>

? ? ? ? ? ? ? <execution>

? ? ? ? ? ? ? ? <id>copy-resources</id>

? ? ? ? ? ? ? ? <phase>process-resourcesphase>

? ? ? ? ? ? ? ? <goals>

? ? ? ? ? ? ? ? ? <goal>copy-resources</goal>

? ? ? ? ? ? ? ? </goals>

? ? ? ? ? ? ? ? <configuration>

? ? ? ? ? ? ? ? ? <outputDirectory>${basedir}/target/resources</outputDirectory>

? ? ? ? ? ? ? ? ? <resources>? ? ? ? ??

? ? ? ? ? ? ? ? ? ? <resource>

? ? ? ? ? ? ? ? ? ? ? <directory>${project.parent.basedir}/src/resources/extras</directory>

? ? ? ? ? ? ? ? ? ? ? <filtering>true</filtering>

? ? ? ? ? ? ? ? ? ? </resource>

? ? ? ? ? ? ? ? ? </resources>? ? ? ? ? ? ??

? ? ? ? ? ? ? ? </configuration>? ? ? ? ? ??

? ? ? ? ? ? ? </execution>

? ? ? ? ? ? </executions>

? ? ? ? ? </plugin>

? ? ? ? </plugins>

? ? ? ? ...

? ? ? </build>

? ? ? ...

? ? </project>


查看完整回答
反對 回復 2023-05-24
  • 1 回答
  • 0 關(guān)注
  • 171 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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