java - How to specify maven properties in a aggregator POM? -


i have project structure below.in aggregator pom project1 , project 2 defined modules.now if want add maven property can accessed in projects how can it?. best project structure in case.?

if define property <temp.dir>data</temp.dir> in aggregator pom not available in project1 pom.xml , project2 pom.xml.i have duplicate same property in both pom's.

project - project1 - - pom.xml  ---- has parent pom project - project2 - - pom.xml  --- has parent pom project b - pom.xml (aggregator pom) 

update:to clarify more project1 pom , project 2 has different parent pom's.so aggregator pom cannot set parent.

you need set aggregator pom parent of project1 , project2. eg. in project1 , project2 poms add:

<parent>     <groupid>com.agr</groupid>     <artifactid>project-aggregator</artifactid>     <version>1.0.0</version> </parent> 

edit:

i understand project1 , project2 have different parent poms.

the solution know achieve want store properties in parent pom.

i can think of 1 solution, make inheritance chain:

project2parent:

<parent>     <groupid>com.test</groupid>     <artifactid>project1parent</artifactid>     <version>0.0.1</version> </parent> <artifactid>project2parent</artifactid> <version>0.0.1</version> 

aggregator:

<parent>     <groupid>com.test</groupid>     <artifactid>project2parent</artifactid>     <version>0.0.1</version> </parent> <artifactid>aggregator</artifactid> <version>0.0.1</version> 

project1

<parent>     <groupid>com.test</groupid>     <artifactid>aggregator</artifactid>     <version>0.0.1</version> </parent> <artifactid>project1</artifactid> <version>0.0.1</version> 

project2

<parent>     <groupid>com.test</groupid>     <artifactid>aggregator</artifactid>     <version>0.0.1</version> </parent> <artifactid>project2</artifactid> <version>0.0.1</version> 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -