0

I have a ModuleA in ProjectA and ModuleB in ProjectB. There is a profile in ProjectB which needs both the modules to be built. How do we achieve this ?

Basically, I want something like this,

<profile>
    <id>test</id>
    <modules>
       <module>ModuleA</module>  <!-- this throws error -->
       <module>ModuleB</module>
    </modules>
</profile>

I have gone through this question(How to include a maven module outside of the project context?), but the requirement here is to have a profile with both the modules and not add ModuleA as dependency in ProjectB

Steve
  • 381
  • 1
  • 6
  • 16

1 Answers1

0

If you need a profile in both, you need a common parent pom. The parent pom is usually the pom where you declare the modules, so define the profile there.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • I need profile only in ProjectB and thing is both the projects have their own and different parent poms already. – Steve Jul 10 '18 at 05:12