2016-12-13 34 views
1

我的項目是多模塊在多模塊Maven項目。需要訪問的conf /屬性從一個子文件到另一個孩子

parent 

| 
-----Child A 

    src/main/resources/test.conf 
| 
-----Child B 

    src/main/test/ (from here I want to access conf) 

我已經嘗試了多種選擇:

1)增加了Apache的資源包(https://maven.apache.org/apache-resource-bundles/

2)使用pom.xml中的資源標籤 With maven - clean package, xml source files are not included in classpath

+0

一個觀察:我可以補充的.properties和.xml。只有.conf文件不添加作爲罐子 –

+0

的一部分,儘管你的問題似乎是說,我想知道答案如何尊重你的要求,你想從另一個孩子訪問'test.conf'。 – JimHawkins

+0

我已經加入小孩B兒童A.在依賴關係的conf是JAR的組成部分,現在,我可以訪問這些的conf –

回答

1

下面是我的答案,您需要從conf中刪除排除,如果你有這個插件,您可以檢查

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>${jar.plugin.version}</version> <configuration> <excludes> <exclude>job.xml</exclude> </excludes> </configuration> </plugin>
相關問題