Re: How to share the same modules between different profiles

2022-09-30 Thread Arnaud bourree
Hi,

Your pom module inherit from your own pom parent which will inherit from
sprint boot-starter.

Regardes,

Arnaud


Le ven. 30 sept. 2022, 16:52, Thai Le  a écrit :

> Thank you, this makes sense to me now that I added the profiles to all the
> pom of the modules. Most of our modules are inherited from
> spring-boot-starter so it is not possible to add the profiles there.
>
> Thai Le
>
> On Fri, 30 Sept 2022 at 02:26, Arnaud bourree 
> wrote:
>
> > Hi,
> >
> > Your pom agregator doesn't need to be aware about testing profiles, its
> job
> > is only agregating.
> > The 70 poms should have a parent pom (bom) within your testing profile.
> >
> > Regardes,
> >
> > Arnaud
> >
> > Le jeu. 29 sept. 2022, 00:06, Delany  a
> écrit
> > :
> >
> > > Shouldn't matter. Please give full pom.
> > > Delany
> > >
> > > On Wed, 28 Sep 2022, 23:15 Thai Le,  wrote:
> > >
> > > > Thanks for your input. That's the first thing I tried. Unfortunately,
> > if
> > > I
> > > > do that none of the modules recognized the profiles.
> > > >
> > > > On Wed, Sep 28, 2022, 17:08 Delany 
> wrote:
> > > >
> > > > > Why did you duplicate modules in the profiles? Just leave them
> under
> > > > > project.
> > > > > Delany
> > > > >
> > > > >
> > > > > On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:
> > > > >
> > > > > > Hello,
> > > > > >
> > > > > > I have an aggregator pom with 70 modules to be built.
> > > > > > 
> > > > > >   4.0.0
> > > > > >   company
> > > > > >   packaging-pom
> > > > > >   1
> > > > > >   pom
> > > > > >70 modules listed here 
> > > > > > 
> > > > > > Recently we are introducing pact testing into our build pipeline
> > so I
> > > > > made
> > > > > > 2 profiles. One is for running pact consumer test which excludes
> > all
> > > > the
> > > > > > unit tests ending with *Test and only includes the consumer test.
> > The
> > > > > other
> > > > > > one is for running pact provider tests which excludes all unit
> > tests
> > > > and
> > > > > > pact consumer tests so that only pact provider tests can run.
> The 2
> > > > > > profiles should be applied to all the 70 modules. One way to do
> > that
> > > is
> > > > > to
> > > > > > put the modules inside each profile thus the modules are
> > duplicated.
> > > > > > 
> > > > > >   4.0.0
> > > > > >   company
> > > > > >   packaging-pom
> > > > > >   1
> > > > > >   pom
> > > > > >
> > > > > >   
> > > > > > 
> > > > > >   consumer-pact-test
> > > > > >   * 70 modules listed here *
> > > > > >   ...
> > > > > > 
> > > > > >
> > > > > > 
> > > > > >   provider-pact-test
> > > > > >   * 70 modules listed here *
> > > > > >   ...
> > > > > > 
> > > > > >
> > > > > >   
> > > > > > 
> > > > > > Imagine if I had to add 10 more profiles. Is there other ways to
> > > share
> > > > > the
> > > > > > same modules between multiple profiles without duplicating them ?
> > > > > >
> > > > > > Regards
> > > > > >
> > > > > > Thai Le
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
> --
> Where there is will, there is a way
>


Re: How to share the same modules between different profiles

2022-09-30 Thread Thai Le
Thank you, this makes sense to me now that I added the profiles to all the
pom of the modules. Most of our modules are inherited from
spring-boot-starter so it is not possible to add the profiles there.

Thai Le

On Fri, 30 Sept 2022 at 02:26, Arnaud bourree 
wrote:

> Hi,
>
> Your pom agregator doesn't need to be aware about testing profiles, its job
> is only agregating.
> The 70 poms should have a parent pom (bom) within your testing profile.
>
> Regardes,
>
> Arnaud
>
> Le jeu. 29 sept. 2022, 00:06, Delany  a écrit
> :
>
> > Shouldn't matter. Please give full pom.
> > Delany
> >
> > On Wed, 28 Sep 2022, 23:15 Thai Le,  wrote:
> >
> > > Thanks for your input. That's the first thing I tried. Unfortunately,
> if
> > I
> > > do that none of the modules recognized the profiles.
> > >
> > > On Wed, Sep 28, 2022, 17:08 Delany  wrote:
> > >
> > > > Why did you duplicate modules in the profiles? Just leave them under
> > > > project.
> > > > Delany
> > > >
> > > >
> > > > On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:
> > > >
> > > > > Hello,
> > > > >
> > > > > I have an aggregator pom with 70 modules to be built.
> > > > > 
> > > > >   4.0.0
> > > > >   company
> > > > >   packaging-pom
> > > > >   1
> > > > >   pom
> > > > >70 modules listed here 
> > > > > 
> > > > > Recently we are introducing pact testing into our build pipeline
> so I
> > > > made
> > > > > 2 profiles. One is for running pact consumer test which excludes
> all
> > > the
> > > > > unit tests ending with *Test and only includes the consumer test.
> The
> > > > other
> > > > > one is for running pact provider tests which excludes all unit
> tests
> > > and
> > > > > pact consumer tests so that only pact provider tests can run. The 2
> > > > > profiles should be applied to all the 70 modules. One way to do
> that
> > is
> > > > to
> > > > > put the modules inside each profile thus the modules are
> duplicated.
> > > > > 
> > > > >   4.0.0
> > > > >   company
> > > > >   packaging-pom
> > > > >   1
> > > > >   pom
> > > > >
> > > > >   
> > > > > 
> > > > >   consumer-pact-test
> > > > >   * 70 modules listed here *
> > > > >   ...
> > > > > 
> > > > >
> > > > > 
> > > > >   provider-pact-test
> > > > >   * 70 modules listed here *
> > > > >   ...
> > > > > 
> > > > >
> > > > >   
> > > > > 
> > > > > Imagine if I had to add 10 more profiles. Is there other ways to
> > share
> > > > the
> > > > > same modules between multiple profiles without duplicating them ?
> > > > >
> > > > > Regards
> > > > >
> > > > > Thai Le
> > > > >
> > > >
> > >
> >
>


-- 
Where there is will, there is a way


Re: How to share the same modules between different profiles

2022-09-30 Thread Thai Le
Here is my aggregator pom (taking out other 67 modules)


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;>
  4.0.0
  cnp
  packaging-pom
  1
  pom
  
6-demo-service/demo-service
60002-service1/service1
60003-service2/service2
  
  

  consumer-pact-test
  

  
maven-surefire-plugin
2.22.2

  

default-test
test

  test


  
  
**/Test*.java
**/*Test.java
**/*Tests.java
**/*TestCase.java
  
  
  
**/*CPT
  

  

  

  


  provider-pact-test
  

  
maven-surefire-plugin
2.22.2

  

default-test
test

  test


  
  
**/Test*.java
**/*Test.java
**/*Tests.java
**/*TestCase.java
  

  
  
integration-test

  test


  
**/Test*
**/*Test
**/*Tests
**/*TestCase
  
  
**/*PPT
  

  

  

  

  
  

  
org.apache.maven.plugins
maven-deploy-plugin
3.0.0-M1

  true

false
  
  
au.com.dius.pact.provider
maven
4.1.17
true
  

  




With this pom, if i run:
mvn --activate-profiles provider-pact-test -Dpackbroker.scheme=http
-Dpactbroker.host=localhost -Dpactbroker.port=9292
-Dpactbroker.auth.username=pact_workshop
-Dpactbroker.auth.password=pact_workshop
-Dpact.provider.version="7.0.36-$(git rev-parse --short HEAD)" -f
all-modules-pom.xml verify
then i see all the unit test (end with *Test) running:
[image: image.png]
If i run
mvn --activate-profiles provider-pact-test -Dpackbroker.scheme=http
-Dpactbroker.host=localhost -Dpactbroker.port=9292
-Dpactbroker.auth.username=pact_workshop
-Dpactbroker.auth.password=pact_workshop
-Dpact.provider.version="7.0.36-$(git rev-parse --short HEAD)" --projects
cn:demo-service --also-make -f all-modules-pom.xml verify
i see the unit tests ran and at the end, i got thiw warning
[WARNING] The requested profile "provider-pact-test" could not be activated
because it does not exist.
this show that the profiles defined at aggregator are not passed down to
the module.

The only way i am able to make it work is to add the profiles to all the
poms of the modules.

On Wed, 28 Sept 2022 at 18:06, Delany  wrote:

> Shouldn't matter. Please give full pom.
> Delany
>
> On Wed, 28 Sep 2022, 23:15 Thai Le,  wrote:
>
> > Thanks for your input. That's the first thing I tried. Unfortunately, if
> I
> > do that none of the modules recognized the profiles.
> >
> > On Wed, Sep 28, 2022, 17:08 Delany  wrote:
> >
> > > Why did you duplicate modules in the profiles? Just leave them under
> > > project.
> > > Delany
> > >
> > >
> > > On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:
> > >
> > > > Hello,
> > > >
> > > > I have an aggregator pom with 70 modules to be built.
> > > > 
> > > >   4.0.0
> > > >   company
> > > >   packaging-pom
> > > >   1
> > > >   pom
> > > >70 modules listed here 
> > > > 
> > > > Recently we are introducing pact testing into our build pipeline so I
> > > made
> > > > 2 profiles. One is for running pact consumer test which excludes all
> > the
> > > > unit tests ending with *Test and only includes the consumer test. The
> > > other
> > > > one is for running pact provider tests which excludes all unit tests
> > and
> > > > pact consumer tests so that only pact provider tests can run. The 2
> > > > profiles should be applied to all the 70 modules. One way to do that
> is
> > > to
> > > > put the modules inside each profile thus the modules are duplicated.
> > > > 
> > > >   4.0.0
> > > >   company
> > > >   packaging-pom
> > > >   1
> > > >   pom
> > > >
> > > >   
> > > > 
> > > >   consumer-pact-test
> > > >   * 70 modules listed here *
> > > >   ...
> > > > 
> > > >
> > > > 
> > > >   

Re: How to share the same modules between different profiles

2022-09-30 Thread Arnaud bourree
Hi,

Your pom agregator doesn't need to be aware about testing profiles, its job
is only agregating.
The 70 poms should have a parent pom (bom) within your testing profile.

Regardes,

Arnaud

Le jeu. 29 sept. 2022, 00:06, Delany  a écrit :

> Shouldn't matter. Please give full pom.
> Delany
>
> On Wed, 28 Sep 2022, 23:15 Thai Le,  wrote:
>
> > Thanks for your input. That's the first thing I tried. Unfortunately, if
> I
> > do that none of the modules recognized the profiles.
> >
> > On Wed, Sep 28, 2022, 17:08 Delany  wrote:
> >
> > > Why did you duplicate modules in the profiles? Just leave them under
> > > project.
> > > Delany
> > >
> > >
> > > On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:
> > >
> > > > Hello,
> > > >
> > > > I have an aggregator pom with 70 modules to be built.
> > > > 
> > > >   4.0.0
> > > >   company
> > > >   packaging-pom
> > > >   1
> > > >   pom
> > > >70 modules listed here 
> > > > 
> > > > Recently we are introducing pact testing into our build pipeline so I
> > > made
> > > > 2 profiles. One is for running pact consumer test which excludes all
> > the
> > > > unit tests ending with *Test and only includes the consumer test. The
> > > other
> > > > one is for running pact provider tests which excludes all unit tests
> > and
> > > > pact consumer tests so that only pact provider tests can run. The 2
> > > > profiles should be applied to all the 70 modules. One way to do that
> is
> > > to
> > > > put the modules inside each profile thus the modules are duplicated.
> > > > 
> > > >   4.0.0
> > > >   company
> > > >   packaging-pom
> > > >   1
> > > >   pom
> > > >
> > > >   
> > > > 
> > > >   consumer-pact-test
> > > >   * 70 modules listed here *
> > > >   ...
> > > > 
> > > >
> > > > 
> > > >   provider-pact-test
> > > >   * 70 modules listed here *
> > > >   ...
> > > > 
> > > >
> > > >   
> > > > 
> > > > Imagine if I had to add 10 more profiles. Is there other ways to
> share
> > > the
> > > > same modules between multiple profiles without duplicating them ?
> > > >
> > > > Regards
> > > >
> > > > Thai Le
> > > >
> > >
> >
>


Re: How to share the same modules between different profiles

2022-09-28 Thread Delany
Shouldn't matter. Please give full pom.
Delany

On Wed, 28 Sep 2022, 23:15 Thai Le,  wrote:

> Thanks for your input. That's the first thing I tried. Unfortunately, if I
> do that none of the modules recognized the profiles.
>
> On Wed, Sep 28, 2022, 17:08 Delany  wrote:
>
> > Why did you duplicate modules in the profiles? Just leave them under
> > project.
> > Delany
> >
> >
> > On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:
> >
> > > Hello,
> > >
> > > I have an aggregator pom with 70 modules to be built.
> > > 
> > >   4.0.0
> > >   company
> > >   packaging-pom
> > >   1
> > >   pom
> > >70 modules listed here 
> > > 
> > > Recently we are introducing pact testing into our build pipeline so I
> > made
> > > 2 profiles. One is for running pact consumer test which excludes all
> the
> > > unit tests ending with *Test and only includes the consumer test. The
> > other
> > > one is for running pact provider tests which excludes all unit tests
> and
> > > pact consumer tests so that only pact provider tests can run. The 2
> > > profiles should be applied to all the 70 modules. One way to do that is
> > to
> > > put the modules inside each profile thus the modules are duplicated.
> > > 
> > >   4.0.0
> > >   company
> > >   packaging-pom
> > >   1
> > >   pom
> > >
> > >   
> > > 
> > >   consumer-pact-test
> > >   * 70 modules listed here *
> > >   ...
> > > 
> > >
> > > 
> > >   provider-pact-test
> > >   * 70 modules listed here *
> > >   ...
> > > 
> > >
> > >   
> > > 
> > > Imagine if I had to add 10 more profiles. Is there other ways to share
> > the
> > > same modules between multiple profiles without duplicating them ?
> > >
> > > Regards
> > >
> > > Thai Le
> > >
> >
>


Re: How to share the same modules between different profiles

2022-09-28 Thread Thai Le
Thanks for your input. That's the first thing I tried. Unfortunately, if I
do that none of the modules recognized the profiles.

On Wed, Sep 28, 2022, 17:08 Delany  wrote:

> Why did you duplicate modules in the profiles? Just leave them under
> project.
> Delany
>
>
> On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:
>
> > Hello,
> >
> > I have an aggregator pom with 70 modules to be built.
> > 
> >   4.0.0
> >   company
> >   packaging-pom
> >   1
> >   pom
> >70 modules listed here 
> > 
> > Recently we are introducing pact testing into our build pipeline so I
> made
> > 2 profiles. One is for running pact consumer test which excludes all the
> > unit tests ending with *Test and only includes the consumer test. The
> other
> > one is for running pact provider tests which excludes all unit tests and
> > pact consumer tests so that only pact provider tests can run. The 2
> > profiles should be applied to all the 70 modules. One way to do that is
> to
> > put the modules inside each profile thus the modules are duplicated.
> > 
> >   4.0.0
> >   company
> >   packaging-pom
> >   1
> >   pom
> >
> >   
> > 
> >   consumer-pact-test
> >   * 70 modules listed here *
> >   ...
> > 
> >
> > 
> >   provider-pact-test
> >   * 70 modules listed here *
> >   ...
> > 
> >
> >   
> > 
> > Imagine if I had to add 10 more profiles. Is there other ways to share
> the
> > same modules between multiple profiles without duplicating them ?
> >
> > Regards
> >
> > Thai Le
> >
>


Re: How to share the same modules between different profiles

2022-09-28 Thread Delany
Why did you duplicate modules in the profiles? Just leave them under
project.
Delany


On Wed, 28 Sep 2022, 21:32 Thai Le,  wrote:

> Hello,
>
> I have an aggregator pom with 70 modules to be built.
> 
>   4.0.0
>   company
>   packaging-pom
>   1
>   pom
>70 modules listed here 
> 
> Recently we are introducing pact testing into our build pipeline so I made
> 2 profiles. One is for running pact consumer test which excludes all the
> unit tests ending with *Test and only includes the consumer test. The other
> one is for running pact provider tests which excludes all unit tests and
> pact consumer tests so that only pact provider tests can run. The 2
> profiles should be applied to all the 70 modules. One way to do that is to
> put the modules inside each profile thus the modules are duplicated.
> 
>   4.0.0
>   company
>   packaging-pom
>   1
>   pom
>
>   
> 
>   consumer-pact-test
>   * 70 modules listed here *
>   ...
> 
>
> 
>   provider-pact-test
>   * 70 modules listed here *
>   ...
> 
>
>   
> 
> Imagine if I had to add 10 more profiles. Is there other ways to share the
> same modules between multiple profiles without duplicating them ?
>
> Regards
>
> Thai Le
>


How to share the same modules between different profiles

2022-09-28 Thread Thai Le
Hello,

I have an aggregator pom with 70 modules to be built.

  4.0.0
  company
  packaging-pom
  1
  pom
   70 modules listed here 

Recently we are introducing pact testing into our build pipeline so I made
2 profiles. One is for running pact consumer test which excludes all the
unit tests ending with *Test and only includes the consumer test. The other
one is for running pact provider tests which excludes all unit tests and
pact consumer tests so that only pact provider tests can run. The 2
profiles should be applied to all the 70 modules. One way to do that is to
put the modules inside each profile thus the modules are duplicated.

  4.0.0
  company
  packaging-pom
  1
  pom

  

  consumer-pact-test
  * 70 modules listed here *
  ...



  provider-pact-test
  * 70 modules listed here *
  ...


  

Imagine if I had to add 10 more profiles. Is there other ways to share the
same modules between multiple profiles without duplicating them ?

Regards

Thai Le