Re: How to include only certain test packages in a maven test-jar & all non test code in a non test jar?

2024-03-29 Thread Debraj Manna
As suggested by Stanimir if I remove the test-jar type and also the
includes like below then mvn package --projects=:agent -T 2 --also-make
works


org.apache.maven.plugins
maven-jar-plugin
3.3.0



test-jar





But if I add back the below inclusion it again starts throwing the
NoClassDefFoundError


 
common/**
 


On Thu, Mar 28, 2024 at 5:51 PM Stanimir Stamenkov
 wrote:

> Thu, 28 Mar 2024, /Debraj Manna/:
>
> > Ok I can try that but I can see the type test-jar from the below
> > documentation
> >
> > https://maven.apache.org/guides/mini/guide-attached-tests.html
>
> I hadn't been aware of it.  It could be specific to the ear-plugin:
>
> * https://issues.apache.org/jira/browse/MEAR-216
>
>
> > On Thu, Mar 28, 2024 at 3:11 PM Stanimir Stamenkov wrote:
> >> Thu, 28 Mar 2024, /Debraj Manna/:
> >>
> >>> 
> >>> com.spotnana
> >>> synapse
> >>> 0.0.1-SNAPSHOT
> >>> tests
> >>> test-jar
> >>
> >> This doesn't seem right.  I'm not aware of test-jar –
> >> should be just jar (or just omit it as it is implied).
>
> --
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: How to include only certain test packages in a maven test-jar & all non test code in a non test jar?

2024-03-28 Thread Debraj Manna
Ok I can try that but I can see the type test-jar from the below
documentation

https://maven.apache.org/guides/mini/guide-attached-tests.html

On Thu, Mar 28, 2024 at 3:11 PM Stanimir Stamenkov
 wrote:

> Thu, 28 Mar 2024, /Debraj Manna/:
>
> > But I am still facing issues in the below case.
> > [...]
> >
> > 
> >com.spotnana
> >synapse
> >0.0.1-SNAPSHOT
> >tests
> >test-jar
>
> This doesn't seem right.  I'm not aware of test-jar –
> should be just jar (or just omit it as it is implied).
>
> >test
> > 
> >
> > Now if I am trying to do mvn package --projects=:agent -T 2 --also-make
> >
> > I am getting NoClassDefFound for common/C.java while tests are being
> > executed in the agent module...
>
> --
> Stanimir
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: How to include only certain test packages in a maven test-jar & all non test code in a non test jar?

2024-03-28 Thread Debraj Manna
Gary

Somehow your message went into my spam folder.

The idea was in synapse there were certain utility classes which other
modules should only use while writing integration tests with synapse. The
test classes are not expected to be used in non-test code by other modules.

synapse also contains test classes to check its code which is not that
relevant for other modules. So I was trying to exclude those codes in the
test-jar.

Since maven --also-make is not working properly with test-jar. I can create
a separate synapse-testing-utility jar which synapse and other modules can
use in their test scope for testing. I think that is what you were
suggesting.

Thanks,


On Fri, Mar 22, 2024 at 4:15 PM Gary Gregory  wrote:

> I think the "simple" solution is to use 2 maven modules, then you don't
> need to do anything special. The layout does not make sense to me so I must
> be missing something. If the common code is needed for both main and test,
> then it should be in main. You can put that common code in its own package
> to signal its specific purpose.
>
> Gary
>
>
> On Fri, Mar 22, 2024, 3:29 AM Debraj Manna 
> wrote:
>
> > I have a Maven module named synapse.
> >
> > main
> >   java
> > package1
> >   A.java
> >
> > test
> >   java
> > common
> >   C.java
> > package1
> >   ATest.java
> >
> > Can someone let me know if in Maven I can create a non-executable jar
> > containing all non-test code (main/) and another test-jar containing only
> > the code under the package test/java/common?
> >
> > I tried the below
> >
> > 
> >   
> >
> > org.springframework.boot
> > spring-boot-maven-plugin
> > 
> >   true
> > 
> >
> >
> >  org.apache.maven.plugins
> >  maven-jar-plugin
> >  3.3.0
> >  
> >   
> > common/**
> >   
> > 
> > 
> >   
> > 
> >   test-jar
> > 
> >   
> > 
> >   
> >  
> >   
> >
> > I am observing that the test-jar is getting created as expected
> containing
> > only the code from test/java/common but the non-executable, non-test jar
> > does not contain the code from main/java/package1.
> >
> >- Maven Version - 3.8.4
> >- Java 17
> >
>


Re: How to include only certain test packages in a maven test-jar & all non test code in a non test jar?

2024-03-27 Thread Debraj Manna
As suggested the below config is working fine


org.apache.maven.plugins
maven-jar-plugin
3.3.0



test-jar



common/**








But I am still facing issues in the below case.


Let's say I have a module agent which depends on synapse and its test-jar.



  com.sp
  synapse
  0.0.1-SNAPSHOT
  compile



  com.spotnana
  synapse
  0.0.1-SNAPSHOT
  tests
  test-jar
  test


Now if I am trying to do mvn package --projects=:agent -T 2 --also-make


I am getting NoClassDefFound for common/C.java while tests are being
executed in the agent module. To get around this I had to do


   1. mvn package --projects=:agent,:synapse -T 2 --also-make
   2. and remove the configuration.includes section in test-jar execution goal

Is this the expected behaviour with --also-make?


On Fri, Mar 22, 2024 at 4:34 PM Stanimir Stamenkov
 wrote:

> See my reply below the quote...
>
> Fri, 22 Mar 2024, /Debraj Manna/:
>
> > [...]
> > I tried the below
> >
> > 
> >
> > 
> >  org.springframework.boot
> >  spring-boot-maven-plugin
> >  
> >true
> >  
> > 
> > 
> >   org.apache.maven.plugins
> >   maven-jar-plugin
> >   3.3.0
> >   
> >
> >  common/**
> >
> >  
> >  
> >
> >  
> >test-jar
> >  
> >
> >  
> >
> >   
> >
> >
> > I am observing that the test-jar is getting created as expected
> containing
> > only the code from test/java/common but the non-executable, non-test jar
> > does not contain the code from main/java/package1.
>
> The easiest way is probably what Gary Gregory has suggested – extract
> the common code in its own module.
>
> Your main JAR is likely missing classes as you've applied 
> configuration globally to the maven-jar-plugin, and not just to the
> "test-jar" execution:
>
>  
>
>  
>test-jar
>  
>  
>
>  common/**
>
>  
>
>  
>
> You may wish to give the execution a non-default ID, and produce
> additional JAR with a different classifier:
>
>  
>
>  common-test-jar
>  
>test-jar
>  
>  
>tests-common
>
>  common/**
>
>  
>
>  
>
> You'll then use the given classifier when specifying this JAR as a test
> dependency to other modules.
>
> See also: "How to create an additional attached jar artifact from the
> project"
> <
> https://maven.apache.org/plugins/maven-jar-plugin/examples/attached-jar.html
> >
>
> --
> Stanimir
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


How to include only certain test packages in a maven test-jar & all non test code in a non test jar?

2024-03-22 Thread Debraj Manna
I have a Maven module named synapse.

main
  java
package1
  A.java

test
  java
common
  C.java
package1
  ATest.java

Can someone let me know if in Maven I can create a non-executable jar
containing all non-test code (main/) and another test-jar containing only
the code under the package test/java/common?

I tried the below


  
   
org.springframework.boot
spring-boot-maven-plugin

  true

   
   
 org.apache.maven.plugins
 maven-jar-plugin
 3.3.0
 
  
common/**
  


  

  test-jar

  

  
 
  

I am observing that the test-jar is getting created as expected containing
only the code from test/java/common but the non-executable, non-test jar
does not contain the code from main/java/package1.

   - Maven Version - 3.8.4
   - Java 17


Re: Maven 4.0 release timeline

2023-12-20 Thread Debraj Manna
When I asked about the release timeline, I was enquiring whether Maven also
has release management documentation like the way some other apache
projects Flink or Kafka do. I was not able to find it for maven 4.

Anyways thanks, Marteen for the references.

https://cwiki.apache.org/confluence/display/FLINK/2.0+Release
https://cwiki.apache.org/confluence/display/KAFKA/Release+Plan+3.7.0

On Tue, Dec 19, 2023 at 9:53 PM 
wrote:

> Thank you!  I'd seen [4] but not sure if I've seen [2]
>
> -Original Message-
> From: Maarten Mulders 
> Sent: Tuesday, December 19, 2023 9:07 AM
> To: users@maven.apache.org
> Subject: Re: Maven 4.0 release timeline
>
>
> CAUTION: This email originated from outside our organisation -
> mthmuld...@apache.org Do not click on links, open attachments, or respond
> unless you recognize the sender and can validate the content is safe.
> On 18/12/2023 21:38, mark.yagnatin...@barclays.com.INVALID wrote:
> > I'm not the original asker but this kind of answer tends to annoy me.
> > Yes, there is no "official" release timeline, you're obviously not going
> to promise anything, all this is (hopefully?) clear, BUT!
> > You no doubt have GUESSES.  And your guesses are no doubt better than
> that of most uninformed outsiders.
> > As an outsider, I have no idea what the "status" of maven 4 is, and I
> can't even begin to guess how I would find out.
> > Should I try to catch up on the last few years of traffic on the
> developer email lists?
> > Or perhaps the answer can be divined from the issue tracker?  If so, how?
> > Is it expected that alpha-10 will be the last alpha, and the next build
> will be a beta?
> > If that is NOT what you expect, then what's the primary hold up?
> > Are there major features that have yet to be implemented?
> > Or perhaps the features are mostly done but they're still a bit buggy?
> > Or perhaps the code quality is pretty solid and you just want to reserve
> the right to make backwards incompatible changes, and there's a policy to
> not do that after hitting beta?
> >
> > You get the idea.  As an insider, you probably think to yourself
> "there's no telling when we'll be done; it depends on a zillion
> unpredictable things".
> > But as outsiders, we don't even know whether the ETA is a few months or
> a few years or a few decades or perhaps just a few weeks.
> >
> > Sorry if that came off as a bit of a rant :)
> The good news is, you don't have to read the mailing list history, nor
> dive into the issue tracker, nor read the git history. If you're curious
> what Maven 4 will bring, I can highly recommend watching Karl-Heinz'
> talk [1]. Don't feel like watching somebody talk? You can read about some
> interesting articles and documentation: [2], [3], [4].
>
> Hope this helps,
>
>
> Maarten
>
>
> [1]
> https://clicktime.symantec.com/15sMvS6QDE6q6Jf47vc58?h=tZSjeMLRMnL1sHS93b7vt02NnPNvJwK6-ee8iyLMi5Q==https://youtu.be/fHeVMbQNbgQ
> [2]
> https://clicktime.symantec.com/15sMFnY8YJe5nk3fmTQtA?h=sQem5P67RYOhsiW9Hm_YeD-PIfsaReOsBbMYvlLdgRk==https://maven.apache.org/guides/mini/guide-multiple-modules-4.html
> [3]
> https://clicktime.symantec.com/15sM1HxHATbJYuZu8nDSJ?h=s87AfscrtMWpDN9FZxBHl_MjXK1i_ohGn2TWRZhFFZ4==https://cwiki.apache.org/confluence/display/MAVEN/Build%2Bvs%2BConsumer%2BPOM
> [4]
> https://clicktime.symantec.com/15sMqbu7kcREgMq8aNCvW?h=2OV2Xb8OY1yozkosb4XLJzGzmH5eCx0rkkaq0thqbr4==https://www.javaadvent.com/2021/12/from-maven-3-to-maven-5.html
>
> PS. Most of the above was exactly one Google search away...: "Maven 4"
>
> > -Original Message-
> > From: Karl Heinz Marbaise 
> > Sent: Monday, December 18, 2023 3:18 PM
> > To: Maven Users List ; Debraj Manna
> > 
> > Subject: Re: Maven 4.0 release timeline
> >
> >
> > CAUTION: This email originated from outside our organisation -
> khmarba...@gmx.de.INVALID Do not click on links, open attachments, or
> respond unless you recognize the sender and can validate the content is
> safe.
> > On 18.12.23 06:27, Debraj Manna wrote:
> >> Can someone let me know when Maven 4 is expected to be released?
> >> Where can I view its release timelines?
> >>
> >
> > We are an open source project. We don't have a release timeline.
> >
> > Maven 4.0.0 will be there when it's there.
> >
> >
> > If you want to help testing, there is 4.0.0-alpha-9 version available
> (at the moment the VOTE for 4.0.0-alpha-10 is running developers list)..
> >
> >
> > https://clicktime.symantec.com/15t5ejZL3AGSyEFA9Aedx?h=ABJzOQGm-e1Zxyu
> > IqUZPLWnHHC2LmzcP6V9UINAuTSc==https://clicktime.symantec.co

Maven 4.0 release timeline

2023-12-17 Thread Debraj Manna
Can someone let me know when Maven 4 is expected to be released? Where can
I view its release timelines?


Re: Re: How to log in surefire which test classes are executed in which surefire thread?

2023-09-14 Thread Debraj Manna
Created https://issues.apache.org/jira/browse/SUREFIRE-2195

On Thu, Sep 14, 2023 at 1:23 PM Olivier Lamy  wrote:

> Please create a jira to attach files as this will not be displayed
> here in the mailing list.
>
> On Thu, 14 Sept 2023 at 17:50, Debraj Manna 
> wrote:
> >
> > Just to add, I am not sure if this is due to concurrent file access.
> Please check the attached screenshot of the console logs. There it is
> saying Test Run 5 but the AirInvoiceServiceTest contains only 1 test. And
> also the report shows random data. For example, sometimes it says Test Run
> 5 , sometimes it says Test Run 2, etc.
> >
> > On Wed, Sep 13, 2023 at 12:11 PM Debraj Manna 
> wrote:
> >>
> >> I am using a surefire dependency like below. Do I have to add anything
> in the plugin dependency for running tests in parallel using Junit5?
> >>
> >> 
> >>   org.apache.maven.plugins
> >>   maven-surefire-plugin
> >>   3.1.2
> >> 
> >>
> >> I will see if I can reproduce it in a small project. In the meantime,
> if I can share some debug logs from surefire which can help in debugging
> the issue let me know, and I can do that.
> >>
> >> Also, if there are any open issues related to this in Surefire, can you
> please share its link so that I can track them on my end?
> >>
> >> On Wed, Sep 13, 2023 at 2:19 AM Olivier Lamy  wrote:
> >>>
> >>> I'm using surefire 3.1.2 and junit 5.9.3 (Oh I have to upgrade :) )
> >>> If you have a simple reproducer project, this would help
> >>>
> >>> On Wed, 13 Sept 2023 at 04:07, Debraj Manna 
> wrote:
> >>> >
> >>> > I am still facing the issue with
> >>> > junit.jupiter.execution.parallel.config.fixed.parallelism=3, JUnit5
> Version
> >>> > = 5.10.0 and surefire 3.1.2
> >>> >
> >>> > On Tue, Sep 12, 2023 at 6:34 PM Debraj Manna <
> subharaj.ma...@gmail.com>
> >>> > wrote:
> >>> >
> >>> > > Olivier
> >>> > >
> >>> > > Can you please let me know what version of Surefire and JUnit5 you
> are
> >>> > > using?
> >>> > >
> >>> > > Thanks
> >>> > >
> >>> > > On Tue, Sep 12, 2023 at 5:16 PM Olivier Lamy 
> wrote:
> >>> > >
> >>> > >> Maybe concurrent access to files in surefire
> >>> > >> I'm using this extensively but only with 3 max parallel test.
> >>> > >> Can you try
> >>> > >> junit.jupiter.execution.parallel.config.fixed.parallelism=3
> >>> > >> And see if you still have the issues.
> >>> > >> If not and if increasing this number is causing the issue. This
> sound
> >>> > >> like a concurrent flle access issue with surefire.
> >>> > >>
> >>> > >> On Tue, 12 Sept 2023 at 18:02, Debraj Manna <
> subharaj.ma...@gmail.com>
> >>> > >> wrote:
> >>> > >> >
> >>> > >> > Hi
> >>> > >> >
> >>> > >> > I started using junit-platform.properties as suggested here. My
> >>> > >> > configuration looks like below
> >>> > >> >
> >>> > >> > junit.jupiter.execution.parallel.enabled=true
> >>> > >> > junit.jupiter.execution.parallel.config.strategy=fixed
> >>> > >> > junit.jupiter.execution.parallel.config.fixed.parallelism=8
> >>> > >> > junit.jupiter.execution.parallel.mode.default=same_thread
> >>> > >> > junit.jupiter.execution.parallel.mode.classes.default=concurrent
> >>> > >> >
> >>> > >> > I am observing the surefire reports that are getting generated
> are not
> >>> > >> > correct
> >>> > >> >
> >>> > >> > I have a test class named
> >>> > >> >
> com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest
> >>> > >> > contains just a single test, testAirTicketing().
> >>> > >> >
> >>> > >> > But in the report file,
> >>> > >> >
> >>> > >>
> TEST-com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest.xml
> >>> > >> >  I see like below
> >>> > >> >
> >

Re: Re: How to log in surefire which test classes are executed in which surefire thread?

2023-09-14 Thread Debraj Manna
Just to add, I am not sure if this is due to concurrent file access. Please
check the attached screenshot of the console logs. There it is saying Test
Run 5 but the AirInvoiceServiceTest contains only 1 test. And also the
report shows random data. For example, sometimes it says Test Run 5 ,
sometimes it says Test Run 2, etc.

On Wed, Sep 13, 2023 at 12:11 PM Debraj Manna 
wrote:

> I am using a surefire dependency like below. Do I have to add anything in
> the plugin dependency for running tests in parallel using Junit5?
>
> 
>   org.apache.maven.plugins
>   maven-surefire-plugin
>   3.1.2
> 
>
> I will see if I can reproduce it in a small project. In the meantime, if I
> can share some debug logs from surefire which can help in debugging the
> issue let me know, and I can do that.
>
> Also, if there are any open issues related to this in Surefire, can you
> please share its link so that I can track them on my end?
>
> On Wed, Sep 13, 2023 at 2:19 AM Olivier Lamy  wrote:
>
>> I'm using surefire 3.1.2 and junit 5.9.3 (Oh I have to upgrade :) )
>> If you have a simple reproducer project, this would help
>>
>> On Wed, 13 Sept 2023 at 04:07, Debraj Manna 
>> wrote:
>> >
>> > I am still facing the issue with
>> > junit.jupiter.execution.parallel.config.fixed.parallelism=3, JUnit5
>> Version
>> > = 5.10.0 and surefire 3.1.2
>> >
>> > On Tue, Sep 12, 2023 at 6:34 PM Debraj Manna 
>> > wrote:
>> >
>> > > Olivier
>> > >
>> > > Can you please let me know what version of Surefire and JUnit5 you are
>> > > using?
>> > >
>> > > Thanks
>> > >
>> > > On Tue, Sep 12, 2023 at 5:16 PM Olivier Lamy 
>> wrote:
>> > >
>> > >> Maybe concurrent access to files in surefire
>> > >> I'm using this extensively but only with 3 max parallel test.
>> > >> Can you try
>> > >> junit.jupiter.execution.parallel.config.fixed.parallelism=3
>> > >> And see if you still have the issues.
>> > >> If not and if increasing this number is causing the issue. This sound
>> > >> like a concurrent flle access issue with surefire.
>> > >>
>> > >> On Tue, 12 Sept 2023 at 18:02, Debraj Manna <
>> subharaj.ma...@gmail.com>
>> > >> wrote:
>> > >> >
>> > >> > Hi
>> > >> >
>> > >> > I started using junit-platform.properties as suggested here. My
>> > >> > configuration looks like below
>> > >> >
>> > >> > junit.jupiter.execution.parallel.enabled=true
>> > >> > junit.jupiter.execution.parallel.config.strategy=fixed
>> > >> > junit.jupiter.execution.parallel.config.fixed.parallelism=8
>> > >> > junit.jupiter.execution.parallel.mode.default=same_thread
>> > >> > junit.jupiter.execution.parallel.mode.classes.default=concurrent
>> > >> >
>> > >> > I am observing the surefire reports that are getting generated are
>> not
>> > >> > correct
>> > >> >
>> > >> > I have a test class named
>> > >> >
>> com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest
>> > >> > contains just a single test, testAirTicketing().
>> > >> >
>> > >> > But in the report file,
>> > >> >
>> > >>
>> TEST-com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest.xml
>> > >> >  I see like below
>> > >> >
>> > >> > http://www.w3.org/2001/XMLSchema-instance;
>> > >> > xsi:noNamespaceSchemaLocation="
>> > >> >
>> > >>
>> https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd
>> > >> "
>> > >> > version="3.0"
>> > >>
>> *name="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
>> > >> > time="44.711" tests="2" errors="1" skipped="0" failures="0”>*
>> > >> >
>> > >> > …
>> > >> >
>> > >> >
>> > >> > *  > > >> >
>> > >>
>> classname="com.spotnana.servicetests.analytics.ingestion.pnr.AirServiceTest"
>> > >> > time="5.789"/>  > > >> >
>> > >>

Re: Re: How to log in surefire which test classes are executed in which surefire thread?

2023-09-13 Thread Debraj Manna
I am using a surefire dependency like below. Do I have to add anything in
the plugin dependency for running tests in parallel using Junit5?


  org.apache.maven.plugins
  maven-surefire-plugin
  3.1.2


I will see if I can reproduce it in a small project. In the meantime, if I
can share some debug logs from surefire which can help in debugging the
issue let me know, and I can do that.

Also, if there are any open issues related to this in Surefire, can you
please share its link so that I can track them on my end?

On Wed, Sep 13, 2023 at 2:19 AM Olivier Lamy  wrote:

> I'm using surefire 3.1.2 and junit 5.9.3 (Oh I have to upgrade :) )
> If you have a simple reproducer project, this would help
>
> On Wed, 13 Sept 2023 at 04:07, Debraj Manna 
> wrote:
> >
> > I am still facing the issue with
> > junit.jupiter.execution.parallel.config.fixed.parallelism=3, JUnit5
> Version
> > = 5.10.0 and surefire 3.1.2
> >
> > On Tue, Sep 12, 2023 at 6:34 PM Debraj Manna 
> > wrote:
> >
> > > Olivier
> > >
> > > Can you please let me know what version of Surefire and JUnit5 you are
> > > using?
> > >
> > > Thanks
> > >
> > > On Tue, Sep 12, 2023 at 5:16 PM Olivier Lamy  wrote:
> > >
> > >> Maybe concurrent access to files in surefire
> > >> I'm using this extensively but only with 3 max parallel test.
> > >> Can you try
> > >> junit.jupiter.execution.parallel.config.fixed.parallelism=3
> > >> And see if you still have the issues.
> > >> If not and if increasing this number is causing the issue. This sound
> > >> like a concurrent flle access issue with surefire.
> > >>
> > >> On Tue, 12 Sept 2023 at 18:02, Debraj Manna  >
> > >> wrote:
> > >> >
> > >> > Hi
> > >> >
> > >> > I started using junit-platform.properties as suggested here. My
> > >> > configuration looks like below
> > >> >
> > >> > junit.jupiter.execution.parallel.enabled=true
> > >> > junit.jupiter.execution.parallel.config.strategy=fixed
> > >> > junit.jupiter.execution.parallel.config.fixed.parallelism=8
> > >> > junit.jupiter.execution.parallel.mode.default=same_thread
> > >> > junit.jupiter.execution.parallel.mode.classes.default=concurrent
> > >> >
> > >> > I am observing the surefire reports that are getting generated are
> not
> > >> > correct
> > >> >
> > >> > I have a test class named
> > >> > com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest
> > >> > contains just a single test, testAirTicketing().
> > >> >
> > >> > But in the report file,
> > >> >
> > >>
> TEST-com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest.xml
> > >> >  I see like below
> > >> >
> > >> > http://www.w3.org/2001/XMLSchema-instance;
> > >> > xsi:noNamespaceSchemaLocation="
> > >> >
> > >>
> https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd
> > >> "
> > >> > version="3.0"
> > >>
> *name="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
> > >> > time="44.711" tests="2" errors="1" skipped="0" failures="0”>*
> > >> >
> > >> > …
> > >> >
> > >> >
> > >> > *   > >> >
> > >>
> classname="com.spotnana.servicetests.analytics.ingestion.pnr.AirServiceTest"
> > >> > time="5.789"/>   > >> >
> > >>
> classname="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
> > >> > time="33.331”>*
> > >> >
> > >> > It seems to be picking tests from some other class like
> AirServiceTest
> > >> as
> > >> > in this case.
> > >> >
> > >> > Can someone let me know what is going wrong here?
> > >> >
> > >> >
> > >> >- Surefire Version - 3.0.0-M7
> > >> >- JUnit Version -  5.9.3
> > >> >
> > >> > Thanks,
> > >> >
> > >> > On 2023/05/30 06:53:21 Karl Heinz Marbaise wrote:
> > >> > > On 30.05.23 07:24, Debraj Manna wrote:
> > >> > > > 

Re: Re: How to log in surefire which test classes are executed in which surefire thread?

2023-09-12 Thread Debraj Manna
I am still facing the issue with
junit.jupiter.execution.parallel.config.fixed.parallelism=3, JUnit5 Version
= 5.10.0 and surefire 3.1.2

On Tue, Sep 12, 2023 at 6:34 PM Debraj Manna 
wrote:

> Olivier
>
> Can you please let me know what version of Surefire and JUnit5 you are
> using?
>
> Thanks
>
> On Tue, Sep 12, 2023 at 5:16 PM Olivier Lamy  wrote:
>
>> Maybe concurrent access to files in surefire
>> I'm using this extensively but only with 3 max parallel test.
>> Can you try
>> junit.jupiter.execution.parallel.config.fixed.parallelism=3
>> And see if you still have the issues.
>> If not and if increasing this number is causing the issue. This sound
>> like a concurrent flle access issue with surefire.
>>
>> On Tue, 12 Sept 2023 at 18:02, Debraj Manna 
>> wrote:
>> >
>> > Hi
>> >
>> > I started using junit-platform.properties as suggested here. My
>> > configuration looks like below
>> >
>> > junit.jupiter.execution.parallel.enabled=true
>> > junit.jupiter.execution.parallel.config.strategy=fixed
>> > junit.jupiter.execution.parallel.config.fixed.parallelism=8
>> > junit.jupiter.execution.parallel.mode.default=same_thread
>> > junit.jupiter.execution.parallel.mode.classes.default=concurrent
>> >
>> > I am observing the surefire reports that are getting generated are not
>> > correct
>> >
>> > I have a test class named
>> > com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest
>> > contains just a single test, testAirTicketing().
>> >
>> > But in the report file,
>> >
>> TEST-com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest.xml
>> >  I see like below
>> >
>> > http://www.w3.org/2001/XMLSchema-instance;
>> > xsi:noNamespaceSchemaLocation="
>> >
>> https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd
>> "
>> > version="3.0"
>> *name="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
>> > time="44.711" tests="2" errors="1" skipped="0" failures="0”>*
>> >
>> > …
>> >
>> >
>> > *  > >
>> classname="com.spotnana.servicetests.analytics.ingestion.pnr.AirServiceTest"
>> > time="5.789"/>  > >
>> classname="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
>> > time="33.331”>*
>> >
>> > It seems to be picking tests from some other class like  AirServiceTest
>> as
>> > in this case.
>> >
>> > Can someone let me know what is going wrong here?
>> >
>> >
>> >- Surefire Version - 3.0.0-M7
>> >- JUnit Version -  5.9.3
>> >
>> > Thanks,
>> >
>> > On 2023/05/30 06:53:21 Karl Heinz Marbaise wrote:
>> > > On 30.05.23 07:24, Debraj Manna wrote:
>> > > > Thanks, Nils for replying.
>> > > >
>> > > > In JUnit5 it looks like running tests in parallel is still an
>> > experimental
>> > > > feature.
>> > >
>> > > Technically you are correct... but it's already a long time there I
>> > > doubt that it will be removed.
>> > >  > So I was checking if it is possible to do the same via Surefire.
>> > >
>> > > I recommend to use JUnit Jupiter...
>> > >
>> > > Btw: JUnit Jupiter is available in version 5.9.3 and also 5.10.0-M1 is
>> > > available as milestone one...
>> > >
>> > > Furthermore the users guide of 5.10.0-M1
>> > > (
>> >
>> https://junit.org/junit5/docs/5.10.0-M1/user-guide/index.html#writing-tests-parallel-execution
>> > )
>> > > shows that the WARNING about experimental feature has been removed...
>> > >
>> > >   https://junit.org/junit5/docs/current/user-guide/
>> > >
>> > > https://junit.org/junit5/
>> > >
>> > >
>> > > >
>> > > > On Mon, May 29, 2023 at 9:05 PM Nils Breunese 
>> wrote:
>> > > >
>> > > >> I don’t have answers for your Surefire questions, but I wanted to
>> > mention
>> > > >> that you can also tell JUnit 5.9.2 to execute tests in parallel:
>> > > >> https://junit.org/junit5/docs/5.9.2/user-guide/index.html
>> > > >>
>> > > >> Ni

Re: Re: How to log in surefire which test classes are executed in which surefire thread?

2023-09-12 Thread Debraj Manna
Olivier

Can you please let me know what version of Surefire and JUnit5 you are
using?

Thanks

On Tue, Sep 12, 2023 at 5:16 PM Olivier Lamy  wrote:

> Maybe concurrent access to files in surefire
> I'm using this extensively but only with 3 max parallel test.
> Can you try
> junit.jupiter.execution.parallel.config.fixed.parallelism=3
> And see if you still have the issues.
> If not and if increasing this number is causing the issue. This sound
> like a concurrent flle access issue with surefire.
>
> On Tue, 12 Sept 2023 at 18:02, Debraj Manna 
> wrote:
> >
> > Hi
> >
> > I started using junit-platform.properties as suggested here. My
> > configuration looks like below
> >
> > junit.jupiter.execution.parallel.enabled=true
> > junit.jupiter.execution.parallel.config.strategy=fixed
> > junit.jupiter.execution.parallel.config.fixed.parallelism=8
> > junit.jupiter.execution.parallel.mode.default=same_thread
> > junit.jupiter.execution.parallel.mode.classes.default=concurrent
> >
> > I am observing the surefire reports that are getting generated are not
> > correct
> >
> > I have a test class named
> > com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest
> > contains just a single test, testAirTicketing().
> >
> > But in the report file,
> >
> TEST-com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest.xml
> >  I see like below
> >
> > http://www.w3.org/2001/XMLSchema-instance;
> > xsi:noNamespaceSchemaLocation="
> >
> https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd
> "
> > version="3.0"
> *name="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
> > time="44.711" tests="2" errors="1" skipped="0" failures="0”>*
> >
> > …
> >
> >
> > *   >
> classname="com.spotnana.servicetests.analytics.ingestion.pnr.AirServiceTest"
> > time="5.789"/>   >
> classname="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
> > time="33.331”>*
> >
> > It seems to be picking tests from some other class like  AirServiceTest
> as
> > in this case.
> >
> > Can someone let me know what is going wrong here?
> >
> >
> >- Surefire Version - 3.0.0-M7
> >- JUnit Version -  5.9.3
> >
> > Thanks,
> >
> > On 2023/05/30 06:53:21 Karl Heinz Marbaise wrote:
> > > On 30.05.23 07:24, Debraj Manna wrote:
> > > > Thanks, Nils for replying.
> > > >
> > > > In JUnit5 it looks like running tests in parallel is still an
> > experimental
> > > > feature.
> > >
> > > Technically you are correct... but it's already a long time there I
> > > doubt that it will be removed.
> > >  > So I was checking if it is possible to do the same via Surefire.
> > >
> > > I recommend to use JUnit Jupiter...
> > >
> > > Btw: JUnit Jupiter is available in version 5.9.3 and also 5.10.0-M1 is
> > > available as milestone one...
> > >
> > > Furthermore the users guide of 5.10.0-M1
> > > (
> >
> https://junit.org/junit5/docs/5.10.0-M1/user-guide/index.html#writing-tests-parallel-execution
> > )
> > > shows that the WARNING about experimental feature has been removed...
> > >
> > >   https://junit.org/junit5/docs/current/user-guide/
> > >
> > > https://junit.org/junit5/
> > >
> > >
> > > >
> > > > On Mon, May 29, 2023 at 9:05 PM Nils Breunese 
> wrote:
> > > >
> > > >> I don’t have answers for your Surefire questions, but I wanted to
> > mention
> > > >> that you can also tell JUnit 5.9.2 to execute tests in parallel:
> > > >> https://junit.org/junit5/docs/5.9.2/user-guide/index.html
> > > >>
> > > >> Nils.
> > > >>
> > > >>> Op 29 mei 2023 om 16:13 heeft Debraj Manna 
> > > >> het volgende geschreven:
> > > >>>
> > > >>> I updated by command like below
> > > >>>
> > > >>> mvn test -Dorg.slf4j.simpleLogger.showThreadName=true
> > > >>>
> > > >>> But I am observing that all my test classes are being executed in
> > > >>> ThreadStreamConsumer
> > > >>>
> > > >>> [ThreadedStreamConsumer] [INFO] Running
> > > >>> com.spot

RE: Re: How to log in surefire which test classes are executed in which surefire thread?

2023-09-12 Thread Debraj Manna
Hi

I started using junit-platform.properties as suggested here. My
configuration looks like below

junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.config.strategy=fixed
junit.jupiter.execution.parallel.config.fixed.parallelism=8
junit.jupiter.execution.parallel.mode.default=same_thread
junit.jupiter.execution.parallel.mode.classes.default=concurrent

I am observing the surefire reports that are getting generated are not
correct

I have a test class named
com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest
contains just a single test, testAirTicketing().

But in the report file,
TEST-com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest.xml
 I see like below

http://www.w3.org/2001/XMLSchema-instance;
xsi:noNamespaceSchemaLocation="
https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd;
version="3.0" 
*name="com.spotnana.servicetests.backoffice.invoicing.AirInvoiceServiceTest"
time="44.711" tests="2" errors="1" skipped="0" failures="0”>*

…


*https://junit.org/junit5/docs/5.10.0-M1/user-guide/index.html#writing-tests-parallel-execution
)
> shows that the WARNING about experimental feature has been removed...
>
>   https://junit.org/junit5/docs/current/user-guide/
>
> https://junit.org/junit5/
>
>
> >
> > On Mon, May 29, 2023 at 9:05 PM Nils Breunese  wrote:
> >
> >> I don’t have answers for your Surefire questions, but I wanted to
mention
> >> that you can also tell JUnit 5.9.2 to execute tests in parallel:
> >> https://junit.org/junit5/docs/5.9.2/user-guide/index.html
> >>
> >> Nils.
> >>
> >>> Op 29 mei 2023 om 16:13 heeft Debraj Manna 
> >> het volgende geschreven:
> >>>
> >>> I updated by command like below
> >>>
> >>> mvn test -Dorg.slf4j.simpleLogger.showThreadName=true
> >>>
> >>> But I am observing that all my test classes are being executed in
> >>> ThreadStreamConsumer
> >>>
> >>> [ThreadedStreamConsumer] [INFO] Running
> >>> com.spotnana.servicetests.profile.ProfileCreatePersonalUserTest
> >>> ...
> >>> [ThreadedStreamConsumer] [INFO] Running
> >>> com.spotnana.servicetests.profile.PlanServiceTest
> >>>
> >>> So can someone let me know if this is the correct way of logging the
> >>> parallel execution identifier in maven output logs? If yes then what
am I
> >>> doing wrong which is causing all test classes to execute in a single
> >> thread?
> >>>
> >>> Junit Version - 5.9.2
> >>>
> >>>
> >>>> On Mon, May 29, 2023 at 6:53 PM Debraj Manna 
> >>>> wrote:
> >>>>
> >>>> I want to execute test classes concurrently in the same JVM. So my
> >>>> surefire-plugin config looks like below
> >>>>
> >>>> 
> >>>>   org.apache.maven.plugins
> >>>>   maven-surefire-plugin
> >>>>   3.0.0-M7
> >>>>   
> >>>> 
> >>>>   $${surefire.forkNumber}
> >>>> 
> >>>> 
> >>>> 
> >>>>   -Xms512m -Xmx${surefire.max.heap}
> >>>>   -XX:MaxDirectMemorySize=${surefire.max.direct.memory}
> >>>>   -XX:MaxMetaspaceSize=${surefire.metaspace.size}
> >>>>   -XX:+HeapDumpOnOutOfMemoryError @{argLine}
> >>>> 
> >>>> suitesAndClasses
> >>>> false
> >>>> ${surefire.threadCount}
> >>>> 1
> >>>> true
> >>>>   
> >>>> 
> >>>>
> >>>> Can someone let me know if there is a way for me to know which test
> >>>> classes are being executed in which surefire thread?
> >>>>
> >>
> >
>
> Mit freundlichem Gruß
> Karl Heinz Marbaise
> --
> SoftwareEntwicklung Beratung Schulung  Tel.: +49 (0) 2405 / 415 893
> Inhaber Dipl.Ing.(FH) Karl Heinz Marbaise  USt.IdNr: DE191347579
> Hauptstrasse 177
> 52146 Würselen https://www.soebes.de
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Update plexus-archiver to 4.8.0 in maven-archiver

2023-08-20 Thread Debraj Manna
Thanks for checking this.

I am seeing that https://issues.apache.org/jira/browse/MSHARED-1292 is
closed. But I am not able to find maven-archiver, 3.6.1 in mvnrepository
<https://mvnrepository.com/artifact/org.apache.maven/maven-archiver> yet.

On Wed, Aug 9, 2023 at 4:51 PM Slawomir Jaranowski 
wrote:

> Hi
>
> Next version of maven-archiver is ready for release.
>
> I can release new version in next week.
>
>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12317922=12353169
>
>
> wt., 8 sie 2023, 14:12 użytkownik Debraj Manna 
> napisał:
>
> > Hi
> >
> > maven-archiver is getting flagged for CVE-2023-37460
> > <https://nvd.nist.gov/vuln/detail/CVE-2023-37460> in our vulnerability
> > scans. But I am seeing the latest version of maven-archiver (3.6.0) is
> > still using plexus-archiver 4.4.0.
> >
> > Is there any plan to upgrade plexus-archiver to 4.8.0 in maven-archiver?
> >
> > Thanks
> >
>


CVE-2021-26291 in maven-bundle plugin

2023-08-19 Thread Debraj Manna
Hi

In our scan maven-bundle plugin 5.1.5 is getting flagged for CVE-2021-26291
 due to the presence
of maven-compat 3.3.9. I am seeing that the latest version of maven-bundle
plugin, 5.1.9 is also using maven-compat 3.3.9. Is there any plan to update
maven-compat to 3.8.2 at least to get around this CVE?

Thanks


Update plexus-archiver to 4.8.0 in maven-archiver

2023-08-08 Thread Debraj Manna
Hi

maven-archiver is getting flagged for CVE-2023-37460
 in our vulnerability
scans. But I am seeing the latest version of maven-archiver (3.6.0) is
still using plexus-archiver 4.4.0.

Is there any plan to upgrade plexus-archiver to 4.8.0 in maven-archiver?

Thanks


Re: How to log in surefire which test classes are executed in which surefire thread?

2023-05-29 Thread Debraj Manna
Thanks, Nils for replying.

In JUnit5 it looks like running tests in parallel is still an experimental
feature. So I was checking if it is possible to do the same via Surefire.

On Mon, May 29, 2023 at 9:05 PM Nils Breunese  wrote:

> I don’t have answers for your Surefire questions, but I wanted to mention
> that you can also tell JUnit 5.9.2 to execute tests in parallel:
> https://junit.org/junit5/docs/5.9.2/user-guide/index.html
>
> Nils.
>
> > Op 29 mei 2023 om 16:13 heeft Debraj Manna 
> het volgende geschreven:
> >
> > I updated by command like below
> >
> > mvn test -Dorg.slf4j.simpleLogger.showThreadName=true
> >
> > But I am observing that all my test classes are being executed in
> > ThreadStreamConsumer
> >
> > [ThreadedStreamConsumer] [INFO] Running
> > com.spotnana.servicetests.profile.ProfileCreatePersonalUserTest
> > ...
> > [ThreadedStreamConsumer] [INFO] Running
> > com.spotnana.servicetests.profile.PlanServiceTest
> >
> > So can someone let me know if this is the correct way of logging the
> > parallel execution identifier in maven output logs? If yes then what am I
> > doing wrong which is causing all test classes to execute in a single
> thread?
> >
> > Junit Version - 5.9.2
> >
> >
> >> On Mon, May 29, 2023 at 6:53 PM Debraj Manna 
> >> wrote:
> >>
> >> I want to execute test classes concurrently in the same JVM. So my
> >> surefire-plugin config looks like below
> >>
> >> 
> >>  org.apache.maven.plugins
> >>  maven-surefire-plugin
> >>  3.0.0-M7
> >>  
> >>
> >>  $${surefire.forkNumber}
> >>
> >>
> >>
> >>  -Xms512m -Xmx${surefire.max.heap}
> >>  -XX:MaxDirectMemorySize=${surefire.max.direct.memory}
> >>  -XX:MaxMetaspaceSize=${surefire.metaspace.size}
> >>  -XX:+HeapDumpOnOutOfMemoryError @{argLine}
> >>
> >>suitesAndClasses
> >>false
> >>${surefire.threadCount}
> >>1
> >>true
> >>  
> >> 
> >>
> >> Can someone let me know if there is a way for me to know which test
> >> classes are being executed in which surefire thread?
> >>
>


Re: How to log in surefire which test classes are executed in which surefire thread?

2023-05-29 Thread Debraj Manna
I updated by command like below

 mvn test -Dorg.slf4j.simpleLogger.showThreadName=true

But I am observing that all my test classes are being executed in
ThreadStreamConsumer

[ThreadedStreamConsumer] [INFO] Running
com.spotnana.servicetests.profile.ProfileCreatePersonalUserTest
...
[ThreadedStreamConsumer] [INFO] Running
com.spotnana.servicetests.profile.PlanServiceTest

So can someone let me know if this is the correct way of logging the
parallel execution identifier in maven output logs? If yes then what am I
doing wrong which is causing all test classes to execute in a single thread?

Junit Version - 5.9.2


On Mon, May 29, 2023 at 6:53 PM Debraj Manna 
wrote:

> I want to execute test classes concurrently in the same JVM. So my
> surefire-plugin config looks like below
>
> 
>   org.apache.maven.plugins
>   maven-surefire-plugin
>   3.0.0-M7
>   
> 
>   $${surefire.forkNumber}
> 
> 
> 
>   -Xms512m -Xmx${surefire.max.heap}
>   -XX:MaxDirectMemorySize=${surefire.max.direct.memory}
>   -XX:MaxMetaspaceSize=${surefire.metaspace.size}
>   -XX:+HeapDumpOnOutOfMemoryError @{argLine}
> 
> suitesAndClasses
> false
> ${surefire.threadCount}
> 1
> true
>   
> 
>
> Can someone let me know if there is a way for me to know which test
> classes are being executed in which surefire thread?
>


How to log in surefire which test classes are executed in which surefire thread?

2023-05-29 Thread Debraj Manna
I want to execute test classes concurrently in the same JVM. So my
surefire-plugin config looks like below


  org.apache.maven.plugins
  maven-surefire-plugin
  3.0.0-M7
  

  $${surefire.forkNumber}



  -Xms512m -Xmx${surefire.max.heap}
  -XX:MaxDirectMemorySize=${surefire.max.direct.memory}
  -XX:MaxMetaspaceSize=${surefire.metaspace.size}
  -XX:+HeapDumpOnOutOfMemoryError @{argLine}

suitesAndClasses
false
${surefire.threadCount}
1
true
  


Can someone let me know if there is a way for me to know which test classes
are being executed in which surefire thread?


Re: How does reuseFork and forkCount behaves with maven parallel builds?

2023-03-23 Thread Debraj Manna
>
> which means a maximum of 3 jvms running at the same time.


I don't understand this. Why a maximum of 3? If I am running with -T 2
there can be a maximum of 2 JVMs, right?

On Wed, Mar 22, 2023 at 4:51 PM Olivier Lamy  wrote:

> Hi.
> -Tx option will not change anything about how surefire works.
> using this configuration (which is the default):
> 1
> true
>
> means surefire will create only one fork and reuse it BUT only for the
> same maven module.
> With -T2 you will have a maximum of 2 maven modules building in
> parallel which means you can have potentially one surefire forked jvm
> per module
> which means a maximum of 3 jvms running at the same time.
>
>
>
> On Wed, 22 Mar 2023 at 18:53, Debraj Manna 
> wrote:
> >
> > I have a multi-module project. My POM structure is like below
> >
> > root/pom.xml
> >
> > 
> > 
> > a
> > b
> > c
> > d
> > 
> >
> > I am running surefire with reuseForks = true, forkCount = 1. If I am
> > executing all tests at the root level with mvn -T 2 test. How will tests
> be
> > executed?
> >
> > Assuming maven picks modules *a* and *b* to be executed first. Then
> module
> > *a* and Module *b* tests will be executed in two separate JVM and once
> > those are finished. There will be two new JVM spawned which will execute
> > all tests for module c and module d.
> >
> > Is my above understanding correct or the same two JVMs will be reused for
> > executing tests for module *c* and module *d?*
> >
> > I am using surefire 3.0.0-M7. My entire surefire config in root/pom.xml
> > looks like below.
> >
> > 
> >   
> > 
> >   org.apache.maven.plugins
> >   maven-surefire-plugin
> >   3.0.0-M7
> >   
> > 
> >   
> >   false
> >   false
> >   
> >   test
> >   false
> >
> > 3
> >   en
> >   US
> >   $${surefire.forkNumber}
> > 
> > 
> > 
> >   -Xms512m -Xmx3g -XX:MaxDirectMemorySize=512m
> > -XX:MaxMetaspaceSize=768m
> >   -XX:+HeapDumpOnOutOfMemoryError @{argLine}
> >   
> >   --add-modules=jdk.incubator.foreign
> >   --add-opens=java.base/java.lang=ALL-UNNAMED
> >   --add-opens=java.base/java.math=ALL-UNNAMED
> >   --add-opens=java.base/java.util=ALL-UNNAMED
> >   --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
> >   --add-opens=java.base/java.net=ALL-UNNAMED
> >   --add-opens=java.base/java.text=ALL-UNNAMED
> >   --add-opens=java.sql/java.sql=ALL-UNNAMED
> >   
> >   --add-opens=java.base/java.time=ALL-UNNAMED
> >   
> >
> > --add-opens=java.xml/com.sun.org.apache.xpath.internal.jaxp=ALL-UNNAMED
> > 
> >
> > 
> > suitesAndClasses
> > false
> >
> > 
> >
>  
> >
> >
> 
> >
> > 
> > 1
> > true
> >   
> > 
> > 
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


How does reuseFork and forkCount behaves with maven parallel builds?

2023-03-22 Thread Debraj Manna
I have a multi-module project. My POM structure is like below

root/pom.xml



a
b
c
d


I am running surefire with reuseForks = true, forkCount = 1. If I am
executing all tests at the root level with mvn -T 2 test. How will tests be
executed?

Assuming maven picks modules *a* and *b* to be executed first. Then module
*a* and Module *b* tests will be executed in two separate JVM and once
those are finished. There will be two new JVM spawned which will execute
all tests for module c and module d.

Is my above understanding correct or the same two JVMs will be reused for
executing tests for module *c* and module *d?*

I am using surefire 3.0.0-M7. My entire surefire config in root/pom.xml
looks like below.


  

  org.apache.maven.plugins
  maven-surefire-plugin
  3.0.0-M7
  

  
  false
  false
  
  test
  false

3
  en
  US
  $${surefire.forkNumber}



  -Xms512m -Xmx3g -XX:MaxDirectMemorySize=512m
-XX:MaxMetaspaceSize=768m
  -XX:+HeapDumpOnOutOfMemoryError @{argLine}
  
  --add-modules=jdk.incubator.foreign
  --add-opens=java.base/java.lang=ALL-UNNAMED
  --add-opens=java.base/java.math=ALL-UNNAMED
  --add-opens=java.base/java.util=ALL-UNNAMED
  --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
  --add-opens=java.base/java.net=ALL-UNNAMED
  --add-opens=java.base/java.text=ALL-UNNAMED
  --add-opens=java.sql/java.sql=ALL-UNNAMED
  
  --add-opens=java.base/java.time=ALL-UNNAMED
  

--add-opens=java.xml/com.sun.org.apache.xpath.internal.jaxp=ALL-UNNAMED



suitesAndClasses
false







1
true
  




Re: Change log level of a maven plugin

2022-11-09 Thread Debraj Manna
On running mvn with -Dorg.slf4j.simpleLogger.showLogName=true it showed the
logger name with log like below

2022-11-09T05:47:18.8604059Z [INFO]
org.sonarsource.scanner.maven.SonarQubeMojo - SCM writing changed lines
(done) | time=83ms
2022-11-09T05:47:18.8604819Z [INFO]
org.sonarsource.scanner.maven.SonarQubeMojo - Analysis report generated in
287ms, dir size=5.2 MB
2022-11-09T05:47:18.8605606Z [INFO]
org.sonarsource.scanner.maven.SonarQubeMojo - Analysis report compressed in
1993ms, zip size=4.1 MB
2022-11-09T05:47:18.8606333Z [INFO]
org.sonarsource.scanner.maven.SonarQubeMojo - Analysis report uploaded in
282ms


then on executing maven with
-Dorg.slf4j.simpleLogger.log.org.sonarsource.scanner.maven.SonarQubeMojo=error
it changed the log level.

On Tue, Nov 8, 2022 at 11:43 PM Debraj Manna 
wrote:

> Thanks Slawomir. I was also searching how to get the logger name for sonar
> plugin. Trying it.
>
> On Tue, Nov 8, 2022 at 11:12 PM Slawomir Jaranowski <
> s.jaranow...@gmail.com> wrote:
>
>> Hi,
>>
>> You must pass such parameters as systeem properties
>>
>> First you must discover logger name of sonar plugin, so
>>
>> MAVEN_OPTS=-Dorg.slf4j.simpleLogger.showLogName=true mvn ...
>>
>> next
>>
>> MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.=error mvn ...
>>
>>  - must be replaced by propper logger name from the
>> first
>> test.
>>
>> it will be working only if sonar plugin use logger in proper way
>>
>> finally you can create file in project: .mvn/jvm.config with  line:
>> -Dorg.slf4j.simpleLogger.log.=error
>>
>>
>>
>> wt., 8 lis 2022 o 18:23 Debraj Manna 
>> napisał(a):
>>
>> > I want to disable the sonar analysis logs during mvn test coming from
>> the
>> > below plugin.
>> >
>> > 
>> >   org.sonarsource.scanner.maven
>> >   sonar-maven-plugin
>> >   3.9.1.2184
>> >
>> > 
>> >
>> > As per this discussion
>> > <
>> >
>> https://community.sonarsource.com/t/turn-off-console-logging-sonar-log-level/45771/3?u=tuk
>> > >
>> > sonar does not support this. So I tried the solution suggested here
>> > <https://stackoverflow.com/a/49035439/785523> to change log level of a
>> > maven plugin by passing
>> > -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.sonar=warn with
>> mvn
>> > test. But it is not working and I am still seeing INFO logs like below
>> >
>> > 2022-11-08T15:51:02.8677442Z [INFO] Sensor SurefireSensor [java]
>> > 2022-11-08T15:51:02.8678035Z [INFO] parsing
>> > [/codebuild/output/src270901131/src/
>> >
>> >
>> github.com/Spotnana-Tech/spotnana/src/java/back-office/target/surefire-reports
>> > ]
>> > 2022-11-08T15:51:02.8678621Z [INFO] Sensor SurefireSensor [java] (done)
>> |
>> > time=41ms
>> >
>> > I know the above question is not directly related to maven. But if
>> anyone
>> > has any suggestions it is welcome.
>> >
>>
>>
>> --
>> Sławomir Jaranowski
>>
>


Re: Change log level of a maven plugin

2022-11-08 Thread Debraj Manna
Thanks Slawomir. I was also searching how to get the logger name for sonar
plugin. Trying it.

On Tue, Nov 8, 2022 at 11:12 PM Slawomir Jaranowski 
wrote:

> Hi,
>
> You must pass such parameters as systeem properties
>
> First you must discover logger name of sonar plugin, so
>
> MAVEN_OPTS=-Dorg.slf4j.simpleLogger.showLogName=true mvn ...
>
> next
>
> MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.=error mvn ...
>
>  - must be replaced by propper logger name from the first
> test.
>
> it will be working only if sonar plugin use logger in proper way
>
> finally you can create file in project: .mvn/jvm.config with  line:
> -Dorg.slf4j.simpleLogger.log.=error
>
>
>
> wt., 8 lis 2022 o 18:23 Debraj Manna 
> napisał(a):
>
> > I want to disable the sonar analysis logs during mvn test coming from the
> > below plugin.
> >
> > 
> >   org.sonarsource.scanner.maven
> >   sonar-maven-plugin
> >   3.9.1.2184
> >
> > 
> >
> > As per this discussion
> > <
> >
> https://community.sonarsource.com/t/turn-off-console-logging-sonar-log-level/45771/3?u=tuk
> > >
> > sonar does not support this. So I tried the solution suggested here
> > <https://stackoverflow.com/a/49035439/785523> to change log level of a
> > maven plugin by passing
> > -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.sonar=warn with mvn
> > test. But it is not working and I am still seeing INFO logs like below
> >
> > 2022-11-08T15:51:02.8677442Z [INFO] Sensor SurefireSensor [java]
> > 2022-11-08T15:51:02.8678035Z [INFO] parsing
> > [/codebuild/output/src270901131/src/
> >
> >
> github.com/Spotnana-Tech/spotnana/src/java/back-office/target/surefire-reports
> > ]
> > 2022-11-08T15:51:02.8678621Z [INFO] Sensor SurefireSensor [java] (done) |
> > time=41ms
> >
> > I know the above question is not directly related to maven. But if anyone
> > has any suggestions it is welcome.
> >
>
>
> --
> Sławomir Jaranowski
>


Change log level of a maven plugin

2022-11-08 Thread Debraj Manna
I want to disable the sonar analysis logs during mvn test coming from the
below plugin.


  org.sonarsource.scanner.maven
  sonar-maven-plugin
  3.9.1.2184



As per this discussion

sonar does not support this. So I tried the solution suggested here
 to change log level of a
maven plugin by passing
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.sonar=warn with mvn
test. But it is not working and I am still seeing INFO logs like below

2022-11-08T15:51:02.8677442Z [INFO] Sensor SurefireSensor [java]
2022-11-08T15:51:02.8678035Z [INFO] parsing
[/codebuild/output/src270901131/src/
github.com/Spotnana-Tech/spotnana/src/java/back-office/target/surefire-reports
]
2022-11-08T15:51:02.8678621Z [INFO] Sensor SurefireSensor [java] (done) |
time=41ms

I know the above question is not directly related to maven. But if anyone
has any suggestions it is welcome.


Re: Maven 3.8 Difference between thread count and forkcount for suitsAndClasses parallelism

2022-06-07 Thread Debraj Manna
Thanks Enrico for replying.

reuseFork = true is applicable only for a module? I mean same surefire
forked JVM will not be used for another maven module in a multimodule
project. Is it correct?

On Tue, Jun 7, 2022 at 7:22 PM Enrico Olivelli  wrote:

> Debraj,
> each module is running surefire independently.
> I hope that this explains the behavior you are seeing
>
>
> Enrico
>
> Il giorno mar 7 giu 2022 alle ore 15:28 Debraj Manna
>  ha scritto:
> >
> > I have asked the same in stackoverflow
> > <
> https://stackoverflow.com/questions/72515006/maven-3-8-difference-between-thread-count-and-forkcount-for-suitsandclasses-para
> >
> > also. Any one any thoughts?
> >
> > On Mon, Jun 6, 2022 at 7:25 PM Debraj Manna 
> > wrote:
> >
> > > I read the link
> > > <
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
> >
> > > .
> > >
> > > For parallel = classes, mvn test -T 5 , reuseForks = true & forkCount
> = 2
> > > maven will build and run 5 modules in parallel. During the test phase
> of
> > > each module surefire is getting called and surefire is spawning 2 JVM
> to
> > > distribute the tests. Once all the tests are finished in module
> surefire
> > > fork will be termintated. Again a new surefire fork will be created for
> > > executing tests in another module. Only for a module, surefire fork
> will be
> > > reused. Is my understanding correct?
> > >
> > > What happens for suitesAndClasses? How are the tests distributed?
> > >
> > >
> > >
> > > On Mon, Jun 6, 2022 at 1:19 PM Debraj Manna 
> > > wrote:
> > >
> > >> Hi
> > >>
> > >> I am having a surefire configuration like below
> > >>
> > >> 
> > >>  2
> > >>  true
> > >> false
> > >> suitesAndClasses
> > >> 
> > >>
> > >> In a multimodule maven project if I am executing mvn test -T 5 then
> how
> > >> does parallelism work here? Will it be that in surefire fork1 5 tests
> > >> classes will be running in parallel and same in fork2?
> > >>
> > >> Maven Version 3.8.4
> > >> Surefire version 3.0.0-M6
> > >>
> > >>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Maven 3.8 Difference between thread count and forkcount for suitsAndClasses parallelism

2022-06-07 Thread Debraj Manna
I have asked the same in stackoverflow
<https://stackoverflow.com/questions/72515006/maven-3-8-difference-between-thread-count-and-forkcount-for-suitsandclasses-para>
also. Any one any thoughts?

On Mon, Jun 6, 2022 at 7:25 PM Debraj Manna 
wrote:

> I read the link
> <https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html>
> .
>
> For parallel = classes, mvn test -T 5 , reuseForks = true & forkCount = 2
> maven will build and run 5 modules in parallel. During the test phase of
> each module surefire is getting called and surefire is spawning 2 JVM to
> distribute the tests. Once all the tests are finished in module surefire
> fork will be termintated. Again a new surefire fork will be created for
> executing tests in another module. Only for a module, surefire fork will be
> reused. Is my understanding correct?
>
> What happens for suitesAndClasses? How are the tests distributed?
>
>
>
> On Mon, Jun 6, 2022 at 1:19 PM Debraj Manna 
> wrote:
>
>> Hi
>>
>> I am having a surefire configuration like below
>>
>> 
>>  2
>>  true
>> false
>> suitesAndClasses
>> 
>>
>> In a multimodule maven project if I am executing mvn test -T 5 then how
>> does parallelism work here? Will it be that in surefire fork1 5 tests
>> classes will be running in parallel and same in fork2?
>>
>> Maven Version 3.8.4
>> Surefire version 3.0.0-M6
>>
>>


Re: Maven 3.8 Difference between thread count and forkcount for suitsAndClasses parallelism

2022-06-06 Thread Debraj Manna
I read the link
<https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html>
.

For parallel = classes, mvn test -T 5 , reuseForks = true & forkCount = 2
maven will build and run 5 modules in parallel. During the test phase of
each module surefire is getting called and surefire is spawning 2 JVM to
distribute the tests. Once all the tests are finished in module surefire
fork will be termintated. Again a new surefire fork will be created for
executing tests in another module. Only for a module, surefire fork will be
reused. Is my understanding correct?

What happens for suitesAndClasses? How are the tests distributed?



On Mon, Jun 6, 2022 at 1:19 PM Debraj Manna 
wrote:

> Hi
>
> I am having a surefire configuration like below
>
> 
>  2
>  true
> false
> suitesAndClasses
> 
>
> In a multimodule maven project if I am executing mvn test -T 5 then how
> does parallelism work here? Will it be that in surefire fork1 5 tests
> classes will be running in parallel and same in fork2?
>
> Maven Version 3.8.4
> Surefire version 3.0.0-M6
>
>


Maven 3.8 Difference between thread count and forkcount for suitsAndClasses parallelism

2022-06-06 Thread Debraj Manna
Hi

I am having a surefire configuration like below


 2
 true
false
suitesAndClasses


In a multimodule maven project if I am executing mvn test -T 5 then how
does parallelism work here? Will it be that in surefire fork1 5 tests
classes will be running in parallel and same in fork2?

Maven Version 3.8.4
Surefire version 3.0.0-M6


Re: Maven enforcer plugin failing with maven 3.6.1 but passing with maven 3.6.3

2020-08-30 Thread Debraj Manna
This has been answered in stackoverflow
<https://stackoverflow.com/questions/63644201/why-is-maven-enforcer-plugin-failing-with-maven-version-3-6-1-but-passing-with-3>


https://stackoverflow.com/questions/63644201/why-is-maven-enforcer-plugin-failing-with-maven-version-3-6-1-but-passing-with-3

On Sat, Aug 29, 2020 at 6:37 PM Debraj Manna 
wrote:

> I am observing the same behavior with maven docker also. It is passing
> with 3.6.3 but failing with 3.6.1.
>
> Used the below commands
>
> Debrajs-MacBook-Air:es-plugins debrajmanna$ docker run -it --rm --name
> es-plugins -v "$(pwd)":/Users/debrajmanna/code/vnera/es-plugins -w
> /Users/debrajmanna/code/vnera/es-plugins maven:3.6.1 mvn validate
>
> Debrajs-MacBook-Air:es-plugins debrajmanna$ docker run -it --rm --name
> es-plugins -v "$(pwd)":/Users/debrajmanna/code/vnera/es-plugins -w
> /Users/debrajmanna/code/vnera/es-plugins maven:3.6.3 mvn validate
>
> On Sat, Aug 29, 2020 at 5:32 PM Debraj Manna 
> wrote:
>
>> It is failing consistently in our environment. Can you let me know what
>> can cause this difference in behavior?
>>
>> Any other log I can provide that may help in debugging this issue further?
>>
>> On Sat, Aug 29, 2020 at 4:45 PM Karl Heinz Marbaise 
>> wrote:
>>
>>> Hi,
>>>
>>> as already mentioned on SO the behaviour can't be reproduced with the
>>> example project.
>>>
>>> Tested with Maven 3.6.0, 3.6.1, 3.6.2 and 3.6.3...
>>>
>>> Kind regards
>>> Karl Heinz Marbaise
>>> On 29.08.20 08:34, Debraj Manna wrote:
>>> > Hi
>>> >
>>> > In one of my project I am trying to use DependencyConvergence rule with
>>> > maven enforcer plugin. I am observing that if I use maven 3.6.1 then
>>> the
>>> > enforcer is failing with the below error but the same has been working
>>> fine
>>> > with maven 3.6.3. Can someone let me know if this expected? If yes can
>>> > someone point me to the relevant jira under which this issue is fixed
>>> in
>>> > maven 3.6.3.
>>> >
>>> > I have placed a sample project in
>>> https://github.com/debraj-manna/es-plugins
>>> > where this issue can be reproduced.
>>> >
>>> > maven-enforcer-plugin - 3.0.0-M2
>>> >
>>> > Debrajs-MacBook-Air:es-plugins debrajmanna$
>>> > ~/Downloads/apache-maven-3.6.1/bin/mvn validate
>>> > [INFO] Scanning for projects...
>>> > [INFO]
>>> >
>>> 
>>> > [INFO] Reactor Build Order:
>>> > [INFO]
>>> > [INFO] es-plugins
>>> > [pom]
>>> > [INFO] dedup
>>> >   [jar]
>>> > [INFO]
>>> > [INFO] ---< org.example:es-plugins
>>> >> ---
>>> > [INFO] Building es-plugins 1.0-SNAPSHOT
>>> > [1/2]
>>> > [INFO] [ pom
>>> > ]-
>>> > [INFO]
>>> > [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
>>> > (javaversion-dependencyconvergence) @ es-plugins ---
>>> > [INFO]
>>> > [INFO] -< org.example:dedup
>>> >> --
>>> > [INFO] Building dedup 1.0-SNAPSHOT
>>> >   [2/2]
>>> > [INFO] [ jar
>>> > ]-
>>> > [INFO]
>>> > [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
>>> > (javaversion-dependencyconvergence) @ dedup ---
>>> > [WARNING]
>>> > Dependency convergence error for
>>> > com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1
>>> paths to
>>> > dependency are:
>>> > +-org.example:dedup:1.0-SNAPSHOT
>>> >+-org.elasticsearch.test:framework:7.7.1
>>> >
>>> +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1
>>> > and
>>> > +-org.example:dedup:1.0-SNAPSHOT
>>> >+-org.elasticsearch.test:framework:7.7.1
>>> >  +-org.apache.lucene:lucene-test-framework:8.5.1
>>> >
>>> +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.2
>>> >
>>> > [WARNING]
>>> > Dependency convergence error for commons-logging:commons-logging:1.2
>>> paths
>>> > to dependency are:
>>> > +

Re: Maven enforcer plugin failing with maven 3.6.1 but passing with maven 3.6.3

2020-08-29 Thread Debraj Manna
I am observing the same behavior with maven docker also. It is passing with
3.6.3 but failing with 3.6.1.

Used the below commands

Debrajs-MacBook-Air:es-plugins debrajmanna$ docker run -it --rm --name
es-plugins -v "$(pwd)":/Users/debrajmanna/code/vnera/es-plugins -w
/Users/debrajmanna/code/vnera/es-plugins maven:3.6.1 mvn validate

Debrajs-MacBook-Air:es-plugins debrajmanna$ docker run -it --rm --name
es-plugins -v "$(pwd)":/Users/debrajmanna/code/vnera/es-plugins -w
/Users/debrajmanna/code/vnera/es-plugins maven:3.6.3 mvn validate

On Sat, Aug 29, 2020 at 5:32 PM Debraj Manna 
wrote:

> It is failing consistently in our environment. Can you let me know what
> can cause this difference in behavior?
>
> Any other log I can provide that may help in debugging this issue further?
>
> On Sat, Aug 29, 2020 at 4:45 PM Karl Heinz Marbaise 
> wrote:
>
>> Hi,
>>
>> as already mentioned on SO the behaviour can't be reproduced with the
>> example project.
>>
>> Tested with Maven 3.6.0, 3.6.1, 3.6.2 and 3.6.3...
>>
>> Kind regards
>> Karl Heinz Marbaise
>> On 29.08.20 08:34, Debraj Manna wrote:
>> > Hi
>> >
>> > In one of my project I am trying to use DependencyConvergence rule with
>> > maven enforcer plugin. I am observing that if I use maven 3.6.1 then the
>> > enforcer is failing with the below error but the same has been working
>> fine
>> > with maven 3.6.3. Can someone let me know if this expected? If yes can
>> > someone point me to the relevant jira under which this issue is fixed in
>> > maven 3.6.3.
>> >
>> > I have placed a sample project in
>> https://github.com/debraj-manna/es-plugins
>> > where this issue can be reproduced.
>> >
>> > maven-enforcer-plugin - 3.0.0-M2
>> >
>> > Debrajs-MacBook-Air:es-plugins debrajmanna$
>> > ~/Downloads/apache-maven-3.6.1/bin/mvn validate
>> > [INFO] Scanning for projects...
>> > [INFO]
>> > 
>> > [INFO] Reactor Build Order:
>> > [INFO]
>> > [INFO] es-plugins
>> > [pom]
>> > [INFO] dedup
>> >   [jar]
>> > [INFO]
>> > [INFO] ---< org.example:es-plugins
>> >> ---
>> > [INFO] Building es-plugins 1.0-SNAPSHOT
>> > [1/2]
>> > [INFO] [ pom
>> > ]-
>> > [INFO]
>> > [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
>> > (javaversion-dependencyconvergence) @ es-plugins ---
>> > [INFO]
>> > [INFO] -< org.example:dedup
>> >> --
>> > [INFO] Building dedup 1.0-SNAPSHOT
>> >   [2/2]
>> > [INFO] [ jar
>> > ]-
>> > [INFO]
>> > [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
>> > (javaversion-dependencyconvergence) @ dedup ---
>> > [WARNING]
>> > Dependency convergence error for
>> > com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1 paths
>> to
>> > dependency are:
>> > +-org.example:dedup:1.0-SNAPSHOT
>> >+-org.elasticsearch.test:framework:7.7.1
>> >  +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1
>> > and
>> > +-org.example:dedup:1.0-SNAPSHOT
>> >+-org.elasticsearch.test:framework:7.7.1
>> >  +-org.apache.lucene:lucene-test-framework:8.5.1
>> >
>> +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.2
>> >
>> > [WARNING]
>> > Dependency convergence error for commons-logging:commons-logging:1.2
>> paths
>> > to dependency are:
>> > +-org.example:dedup:1.0-SNAPSHOT
>> >+-org.elasticsearch.test:framework:7.7.1
>> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>> >+-org.apache.httpcomponents:httpclient:4.5.10
>> >  +-commons-logging:commons-logging:1.2
>> > and
>> > +-org.example:dedup:1.0-SNAPSHOT
>> >+-org.elasticsearch.test:framework:7.7.1
>> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>> >+-org.apache.httpcomponents:httpasyncclient:4.1.4
>> >  +-commons-logging:commons-logging:1.2
>> > and
>> > +-org.example:dedup:1.0-SNAPSHOT
>> >+-org.elasticsearch.test:framework:7.7.1
>> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7

Re: Maven enforcer plugin failing with maven 3.6.1 but passing with maven 3.6.3

2020-08-29 Thread Debraj Manna
It is failing consistently in our environment. Can you let me know what can
cause this difference in behavior?

Any other log I can provide that may help in debugging this issue further?

On Sat, Aug 29, 2020 at 4:45 PM Karl Heinz Marbaise 
wrote:

> Hi,
>
> as already mentioned on SO the behaviour can't be reproduced with the
> example project.
>
> Tested with Maven 3.6.0, 3.6.1, 3.6.2 and 3.6.3...
>
> Kind regards
> Karl Heinz Marbaise
> On 29.08.20 08:34, Debraj Manna wrote:
> > Hi
> >
> > In one of my project I am trying to use DependencyConvergence rule with
> > maven enforcer plugin. I am observing that if I use maven 3.6.1 then the
> > enforcer is failing with the below error but the same has been working
> fine
> > with maven 3.6.3. Can someone let me know if this expected? If yes can
> > someone point me to the relevant jira under which this issue is fixed in
> > maven 3.6.3.
> >
> > I have placed a sample project in
> https://github.com/debraj-manna/es-plugins
> > where this issue can be reproduced.
> >
> > maven-enforcer-plugin - 3.0.0-M2
> >
> > Debrajs-MacBook-Air:es-plugins debrajmanna$
> > ~/Downloads/apache-maven-3.6.1/bin/mvn validate
> > [INFO] Scanning for projects...
> > [INFO]
> > 
> > [INFO] Reactor Build Order:
> > [INFO]
> > [INFO] es-plugins
> > [pom]
> > [INFO] dedup
> >   [jar]
> > [INFO]
> > [INFO] ---< org.example:es-plugins
> >> ---
> > [INFO] Building es-plugins 1.0-SNAPSHOT
> > [1/2]
> > [INFO] [ pom
> > ]-
> > [INFO]
> > [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
> > (javaversion-dependencyconvergence) @ es-plugins ---
> > [INFO]
> > [INFO] -< org.example:dedup
> >> --
> > [INFO] Building dedup 1.0-SNAPSHOT
> >   [2/2]
> > [INFO] [ jar
> > ]-
> > [INFO]
> > [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
> > (javaversion-dependencyconvergence) @ dedup ---
> > [WARNING]
> > Dependency convergence error for
> > com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1 paths
> to
> > dependency are:
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1
> > and
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-org.apache.lucene:lucene-test-framework:8.5.1
> >
> +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.2
> >
> > [WARNING]
> > Dependency convergence error for commons-logging:commons-logging:1.2
> paths
> > to dependency are:
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
> >+-org.apache.httpcomponents:httpclient:4.5.10
> >  +-commons-logging:commons-logging:1.2
> > and
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
> >+-org.apache.httpcomponents:httpasyncclient:4.1.4
> >  +-commons-logging:commons-logging:1.2
> > and
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
> >+-commons-logging:commons-logging:1.1.3
> > and
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-org.elasticsearch.client:elasticsearch-rest-client-sniffer:7.7.1
> >+-commons-logging:commons-logging:1.1.3
> > and
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-commons-logging:commons-logging:1.1.3
> >
> > [WARNING]
> > Dependency convergence error for
> org.apache.httpcomponents:httpcore:4.4.12
> > paths to dependency are:
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearch.test:framework:7.7.1
> >  +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
> >+-org.apache.httpcomponents:httpclient:4.5.10
> >  +-org.apache.httpcomponents:httpcore:4.4.12
> > and
> > +-org.example:dedup:1.0-SNAPSHOT
> >+-org.elasticsearc

Re: Maven enforcer plugin failing with maven 3.6.1 but passing with maven 3.6.3

2020-08-29 Thread Debraj Manna
Just to be more explicit with maven versions. I tried with maven version
3.6.1, 3.6.3 and 3.5.3. It worked fine only with 3.6.3.

On Sat, Aug 29, 2020 at 12:04 PM Debraj Manna 
wrote:

> Hi
>
> In one of my project I am trying to use DependencyConvergence rule with
> maven enforcer plugin. I am observing that if I use maven 3.6.1 then the
> enforcer is failing with the below error but the same has been working fine
> with maven 3.6.3. Can someone let me know if this expected? If yes can
> someone point me to the relevant jira under which this issue is fixed in
> maven 3.6.3.
>
> I have placed a sample project in
> https://github.com/debraj-manna/es-plugins where this issue can be
> reproduced.
>
> maven-enforcer-plugin - 3.0.0-M2
>
> Debrajs-MacBook-Air:es-plugins debrajmanna$
> ~/Downloads/apache-maven-3.6.1/bin/mvn validate
> [INFO] Scanning for projects...
> [INFO]
> 
> [INFO] Reactor Build Order:
> [INFO]
> [INFO] es-plugins
> [pom]
> [INFO] dedup
>  [jar]
> [INFO]
> [INFO] ---< org.example:es-plugins
> >---
> [INFO] Building es-plugins 1.0-SNAPSHOT
> [1/2]
> [INFO] [ pom
> ]-
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
> (javaversion-dependencyconvergence) @ es-plugins ---
> [INFO]
> [INFO] -< org.example:dedup
> >--
> [INFO] Building dedup 1.0-SNAPSHOT
>  [2/2]
> [INFO] [ jar
> ]-
> [INFO]
> [INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
> (javaversion-dependencyconvergence) @ dedup ---
> [WARNING]
> Dependency convergence error for
> com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1 paths to
> dependency are:
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.apache.lucene:lucene-test-framework:8.5.1
>   +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.2
>
> [WARNING]
> Dependency convergence error for commons-logging:commons-logging:1.2 paths
> to dependency are:
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>   +-org.apache.httpcomponents:httpclient:4.5.10
> +-commons-logging:commons-logging:1.2
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>   +-org.apache.httpcomponents:httpasyncclient:4.1.4
> +-commons-logging:commons-logging:1.2
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>   +-commons-logging:commons-logging:1.1.3
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client-sniffer:7.7.1
>   +-commons-logging:commons-logging:1.1.3
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-commons-logging:commons-logging:1.1.3
>
> [WARNING]
> Dependency convergence error for org.apache.httpcomponents:httpcore:4.4.12
> paths to dependency are:
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>   +-org.apache.httpcomponents:httpclient:4.5.10
> +-org.apache.httpcomponents:httpcore:4.4.12
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>   +-org.apache.httpcomponents:httpcore:4.4.12
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
>   +-org.apache.httpcomponents:httpasyncclient:4.1.4
> +-org.apache.httpcomponents:httpcore:4.4.10
> and
> +-org.example:dedup:1.0-SNAPSHOT
>   +-org.elasticsearch.test:framework:7.7.1
> +-org.elasticsearch.client:elasticsearch-rest-client-sniffer:7.7.1
>   +-org.apache.httpcomponents:httpcore:4.4.12
>
> [WARNING]
> Dependency convergence error for
> org.apache.httpcomponents:httpclient:4.5.10 paths to dependency are:
> +-org.example:dedup:1.0-SNAPSHOT
>   +-

Maven enforcer plugin failing with maven 3.6.1 but passing with maven 3.6.3

2020-08-29 Thread Debraj Manna
Hi

In one of my project I am trying to use DependencyConvergence rule with
maven enforcer plugin. I am observing that if I use maven 3.6.1 then the
enforcer is failing with the below error but the same has been working fine
with maven 3.6.3. Can someone let me know if this expected? If yes can
someone point me to the relevant jira under which this issue is fixed in
maven 3.6.3.

I have placed a sample project in https://github.com/debraj-manna/es-plugins
where this issue can be reproduced.

maven-enforcer-plugin - 3.0.0-M2

Debrajs-MacBook-Air:es-plugins debrajmanna$
~/Downloads/apache-maven-3.6.1/bin/mvn validate
[INFO] Scanning for projects...
[INFO]

[INFO] Reactor Build Order:
[INFO]
[INFO] es-plugins
[pom]
[INFO] dedup
 [jar]
[INFO]
[INFO] ---< org.example:es-plugins
>---
[INFO] Building es-plugins 1.0-SNAPSHOT
[1/2]
[INFO] [ pom
]-
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
(javaversion-dependencyconvergence) @ es-plugins ---
[INFO]
[INFO] -< org.example:dedup
>--
[INFO] Building dedup 1.0-SNAPSHOT
 [2/2]
[INFO] [ jar
]-
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce
(javaversion-dependencyconvergence) @ dedup ---
[WARNING]
Dependency convergence error for
com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1 paths to
dependency are:
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.1
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.apache.lucene:lucene-test-framework:8.5.1
  +-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.7.2

[WARNING]
Dependency convergence error for commons-logging:commons-logging:1.2 paths
to dependency are:
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpclient:4.5.10
+-commons-logging:commons-logging:1.2
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpasyncclient:4.1.4
+-commons-logging:commons-logging:1.2
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-commons-logging:commons-logging:1.1.3
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client-sniffer:7.7.1
  +-commons-logging:commons-logging:1.1.3
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-commons-logging:commons-logging:1.1.3

[WARNING]
Dependency convergence error for org.apache.httpcomponents:httpcore:4.4.12
paths to dependency are:
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpclient:4.5.10
+-org.apache.httpcomponents:httpcore:4.4.12
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpcore:4.4.12
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpasyncclient:4.1.4
+-org.apache.httpcomponents:httpcore:4.4.10
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client-sniffer:7.7.1
  +-org.apache.httpcomponents:httpcore:4.4.12

[WARNING]
Dependency convergence error for
org.apache.httpcomponents:httpclient:4.5.10 paths to dependency are:
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpclient:4.5.10
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client:7.7.1
  +-org.apache.httpcomponents:httpasyncclient:4.1.4
+-org.apache.httpcomponents:httpclient:4.5.6
and
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:framework:7.7.1
+-org.elasticsearch.client:elasticsearch-rest-client-sniffer:7.7.1
  +-org.apache.httpcomponents:httpclient:4.5.10

[WARNING]
Dependency convergence error for
org.apache.httpcomponents:httpcore-nio:4.4.10 paths to dependency are:
+-org.example:dedup:1.0-SNAPSHOT
  +-org.elasticsearch.test:fra

How to disable certain enforcer rules in a child module in a multi-module maven project?

2020-08-13 Thread Debraj Manna
I am using a maven-enforcer plugin in a multi-module maven project. Let's
say my project structure is like below

main
  - query
  - storage

My enforcer plugin in main pom looks like below



org.apache.maven.plugins
maven-enforcer-plugin
3.0.0-M2


default

enforce





[1.8,)
*** This project requires
JDK 1.8/J2SE 8 or later. ***


true





In a child module (query) if I need to disable one of the enforcer rules
(let's say DependencyConvergence) can someone let me know how can this be
done?

Maven Version - 3.6.1


Re: How maven repositories are resolved?

2020-08-12 Thread Debraj Manna
Thanks John for such a detailed explanation. Few doubts

For release version assuming empty local repo.
> - Build order this time alpha, bravo, charlie
> - Alpha needs A, and Aa is downloaded as it's in central repo and that
> was 1st repo in the order list


When you say central repo is the first repo in the order list , how is
order determined? Is it because central repo is defined before company repo
in the settings.xml ?

What is the "cache" you are referring to in your answer?


On Thu, Jul 30, 2020 at 1:33 AM John Patrick  wrote:

> The answer depends on the following;
>
> 1) is it a release version or snapshot version. As if the release
> version is in local repo then no remote repo's are checked.
> 2) order your pom's are executed
>
> I've simplified your profiles with central repo and company repo, and
> Aa, Ab and Ac are the same GAV but it's just so in the explanation
> it's easier to know what A i'm talking about.
>
> settings
> - central repo (contains Aa)
> - company repo (contains Ab)
>
> parent-pom
> - alpha
> -- A
> - bravo (has extra R repository like your cloudera, contains Ac)
> -- A
> - charlie
> -- A
>
> For release version assuming empty local repo.
> - Build order this time alpha, bravo, charlie
> - Alpha needs A, and Aa is downloaded as it's in central repo and that
> was 1st repo in the order list
> - Bravo needs A, it sees Aa in local repo and uses it
> - Charlie needs A, it sees Aa in local repo and uses it
>
> Same as before but maven believe build order is bravo, alpha, charlie,
> i.e. you've changed an internal dependency or reorder you modules
> section.
> - Bravo needs A, and Ac is downloaded as it's in R repo and that was
> 1st repo in the order list, which i think it's pom repo's then parent
> pom's then settings file.
> - Alpha needs A, it sees Ac in local repo and uses it
> - Charlie needs A, it sees Ac in local repo and uses it
>
> Next is if A is a -SNAPSHOT dependency assuming empty local repo, Aa
> is v 1-1, Ab is v1-1 and Ac is v1-1
> - Build order this time alpha, bravo, charlie
> - Alpha needs A, and Aa is downloaded as it's in central repo and that
> was 1st repo in the order list, but it has a cache of Ab existing
> - Bravo needs A, it sees it doesn't have a cache of A from R repo, so
> looks up A from R repo, and if Ac in R repo is newer it is downloaded
> and used. in this case Aa is newer so Aa is used.
> - Charlie needs A, it sees all repo's have caches of A, and just uses
> the A in the local repo, in this case Aa is used.
>
> Next is if A is a -SNAPSHOT dependency assuming empty local repo, Aa
> is v 1-1, Ab is v1-1 and Ac is v1-2
> - Build order this time alpha, bravo, charlie
> - Alpha needs A, and Aa is downloaded as it's in central repo and that
> was 1st repo in the order list, but it has a cache of Ab existing
> - Bravo needs A, it sees it doesn't have a cache of A from R repo, so
> looks up A from R repo, and if Ac in R repo is newer it is downloaded
> and used. in this case Ac is newer so Ac is used.
> - Charlie needs A, it sees all repo's have caches of A, and just uses
> the A in the local repo, in this case Ac is used.
>
>
>
> As you can see it can get very messy when -SNAPSHOT's are being used
> and different pom's have repo. This is my hands-on experience of trial
> and error, debugging and troubleshooting of build processes.
>
> Hope it was helpful.
>
> John
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


How maven repositories are resolved?

2020-07-29 Thread Debraj Manna
Cross-posting from stackoverflow


Let's say my settings.xml is defined like below

http://maven.apache.org/SETTINGS/1.1.0
http://maven.apache.org/xsd/settings-1.1.0.xsd;
xmlns="http://maven.apache.org/SETTINGS/1.1.0;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
 
   
 
   
 
   false
 
 central
 libs-release
 http://artifactory.ark.local:8080/libs-release
   
   
vmware-repo
VM Nexus Repo
http://build-squid.eng.vm.com/nexus/content/groups/repo

true


false


   
 
 snapshots
 libs-snapshot
 http://artifactory.ark.local:8080/libs-snapshot
   
 
 
   
 
   false
 
 central
 plugins-release
 http://artifactory.ark.local:8080/plugins-release
   
   
 
 snapshots
 plugins-snapshot
 http://artifactory.ark.local:8080/plugins-snapshot
   
 
 artifactory
   
 
 
   artifactory
 

In a multimodule project of the form

main
storage
metrics
config
common

Let's say in metrics pom if a repository is added.


  cloudera
  
https://repository.cloudera.com/artifactory/cloudera-repos/


   1.

   If a dependency is defined in A which is present in both cloudera repo
   and local nexus repo how maven will resolve the repository? Will, it first
   try to download from cloudera repo and if there is some problem then it
   will go in local nexus repo or it will check only in cloudera repo and if
   it is not present it will give error without trying from local nexus repo?
   2.

   Does the answer to the above question change based on if A is defined as
   a dependency in metric or some other pom where the repository is not
   defined?

Maven Version - 3.6.3


Re: Maven brings “test” transitive dependency as “compile”

2020-05-28 Thread Debraj Manna
Thanks Andy.

It was a part of big multi-module project which I tried to extract out. So
I missed excluding it in some places.

On Wed, May 27, 2020 at 5:01 AM Andy Feldman  wrote:

> Thanks for an easy public reproduction!
>
> netty-common is coming through with compile scope from:
> org.elasticsearch.client:transport:jar:5.6.16:compile
>  -> org.elasticsearch.plugin:transport-netty4-client:jar:5.6.16:compile
>  ---> io.netty:netty-common:jar:4.1.13.Final:compile
>
> I found this by excluding the netty-common dependency
> from bookkeeper-common and running dependency:tree again, which actually
> you said you did as well, so I'm curious what we did differently.
>
> Anyway, I hope this helps!
> --
> Andy Feldman
> Wealthfront
>
>
>
> On Tue, May 26, 2020 at 11:59 AM Debraj Manna 
> wrote:
>
> > You can reproduce the issue in
> > https://github.com/debraj-manna/dependency-issue
> >
> > In dependency tree of delete I am seeing dependency as below
> >
> > [INFO] \-
> > org.apache.bookkeeper:bookkeeper-common:test-jar:tests:4.10.0:test
> > [INFO]+-
> > org.apache.bookkeeper.stats:bookkeeper-stats-api:jar:4.10.0:test
> > [INFO]+- org.apache.bookkeeper:cpu-affinity:jar:4.10.0:test
> > *[INFO]+- io.netty:netty-common:jar:4.1.32.Final:compile*
> > [INFO]+-
> com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
> > [INFO]+-
> > com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
> > [INFO]+- org.jctools:jctools-core:jar:2.1.2:test
> > [INFO]+- org.slf4j:slf4j-api:jar:1.7.25:test
> > [INFO]\- commons-configuration:commons-configuration:jar:1.10:test
> >
> >
> > On Sun, May 24, 2020 at 2:47 AM Nick Stolwijk 
> > wrote:
> >
> > > The verbose flag was removed in newer versions of the plugin. You could
> > try
> > > an old pluginversion:
> > >
> > > mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree
> -Dverbose
> > >
> > > With regards,
> > >
> > > Nick Stolwijk
> > >
> > > ~~~ Try to leave this world a little better than you found it and, when
> > > your turn comes to die, you can die happy in feeling that at any rate
> you
> > > have not wasted your time but have done your best ~~~
> > >
> > > Lord Baden-Powell
> > >
> > >
> > > On Sat, May 23, 2020 at 7:53 PM Debraj Manna  >
> > > wrote:
> > >
> > > > Yes I saw the documentation. It is not behaving as expected.
> > > >
> > > > Can you let me know what is the alternative for maven dependency:tree
> > > > -Dverbose  ? If I get the verbose mode for dependency:tree then I
> think
> > > > that will provide us more information.
> > > >
> > > > On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki
>  > >
> > > > wrote:
> > > >
> > > > > Debraj,
> > > > >
> > > > > I couldn't reproduce the problem in my setting. Netty-common
> appears
> > as
> > > > > test scope.
> > > > > https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
> > > > >
> > > > > Would you be willing to create a minimum reproducible project?
> > > > > Hopefully it builds only artifacts available on the public Internet
> > (no
> > > > > artifactory.arkin.local:8000).
> > > > >
> > > > > BTW, this is the documentation I think your Maven tree is not
> > behaving
> > > as
> > > > > documented:
> > > > >
> > > > >
> > > >
> > >
> >
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Sat, May 23, 2020 at 12:40 AM Debraj Manna <
> > > subharaj.ma...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Thanks Andy for replying.
> > > > > >
> > > > > > maven dependency:tree -Dverbose does not seem to work for me. It
> > > gives
> > > > me
> > > > > > the below message
> > > > > >
> > > > > > ...
> > > > > > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @
> > delete
> > > > ---
> > > > > > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > > > &g

Re: Maven brings “test” transitive dependency as “compile”

2020-05-26 Thread Debraj Manna
You can reproduce the issue in
https://github.com/debraj-manna/dependency-issue

In dependency tree of delete I am seeing dependency as below

[INFO] \- org.apache.bookkeeper:bookkeeper-common:test-jar:tests:4.10.0:test
[INFO]+-
org.apache.bookkeeper.stats:bookkeeper-stats-api:jar:4.10.0:test
[INFO]+- org.apache.bookkeeper:cpu-affinity:jar:4.10.0:test
*[INFO]+- io.netty:netty-common:jar:4.1.32.Final:compile*
[INFO]+- com.fasterxml.jackson.core:jackson-databind:jar:2.9.7:compile
[INFO]+-
com.fasterxml.jackson.core:jackson-annotations:jar:2.9.7:compile
[INFO]+- org.jctools:jctools-core:jar:2.1.2:test
[INFO]+- org.slf4j:slf4j-api:jar:1.7.25:test
[INFO]\- commons-configuration:commons-configuration:jar:1.10:test


On Sun, May 24, 2020 at 2:47 AM Nick Stolwijk 
wrote:

> The verbose flag was removed in newer versions of the plugin. You could try
> an old pluginversion:
>
> mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:tree -Dverbose
>
> With regards,
>
> Nick Stolwijk
>
> ~~~ Try to leave this world a little better than you found it and, when
> your turn comes to die, you can die happy in feeling that at any rate you
> have not wasted your time but have done your best ~~~
>
> Lord Baden-Powell
>
>
> On Sat, May 23, 2020 at 7:53 PM Debraj Manna 
> wrote:
>
> > Yes I saw the documentation. It is not behaving as expected.
> >
> > Can you let me know what is the alternative for maven dependency:tree
> > -Dverbose  ? If I get the verbose mode for dependency:tree then I think
> > that will provide us more information.
> >
> > On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki 
> > wrote:
> >
> > > Debraj,
> > >
> > > I couldn't reproduce the problem in my setting. Netty-common appears as
> > > test scope.
> > > https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
> > >
> > > Would you be willing to create a minimum reproducible project?
> > > Hopefully it builds only artifacts available on the public Internet (no
> > > artifactory.arkin.local:8000).
> > >
> > > BTW, this is the documentation I think your Maven tree is not behaving
> as
> > > documented:
> > >
> > >
> >
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
> > >
> > >
> > >
> > >
> > > On Sat, May 23, 2020 at 12:40 AM Debraj Manna <
> subharaj.ma...@gmail.com>
> > > wrote:
> > >
> > > > Thanks Andy for replying.
> > > >
> > > > maven dependency:tree -Dverbose does not seem to work for me. It
> gives
> > me
> > > > the below message
> > > >
> > > > ...
> > > > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete
> > ---
> > > > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > > > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > > > ...
> > > >
> > > > If I just exclude netty-common from apache-bookkeeper then
> netty-common
> > > > 4.1.32 does not show up in the dependency tree.
> > > >
> > > >
> > > > On Sat, May 23, 2020 at 3:57 AM Andy Feldman 
> > > > wrote:
> > > >
> > > > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna <
> > subharaj.ma...@gmail.com
> > > >
> > > > > wrote:
> > > > >
> > > > > > bookkeeper-common is in test scope but still netty-common is
> > showing
> > > up
> > > > > as
> > > > > > compile dependency.
> > > > > >
> > > > >
> > > > > Is it possible that netty-common is a transitive dependency of
> > another
> > > > > dependency as well? Running dependency:tree does not show all paths
> > to
> > > > each
> > > > > dependency.
> > > > >
> > > > > You can try running dependency:tree with the verbose flag to see
> more
> > > > > branches of the tree, although the documentation says it is not
> > > > guaranteed
> > > > > to work properly with Maven 3.
> > > > >
> > > > >
> > > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > > > >
> > > > > You can also try removing the dependency on bookkeeper-common and
> > > running
> > > > > dependency:tree again to see if netty-common still shows up.
> > > > >
> > > > > --
> > > > > Andy Feldman
> > > > > Wealthfront
> > > > >
> > > >
> > >
> > >
> > > --
> > > Regards,
> > > Tomo
> > >
> >
>


Re: Maven brings “test” transitive dependency as “compile”

2020-05-23 Thread Debraj Manna
Yes I saw the documentation. It is not behaving as expected.

Can you let me know what is the alternative for maven dependency:tree
-Dverbose  ? If I get the verbose mode for dependency:tree then I think
that will provide us more information.

On Sat, May 23, 2020 at 6:09 PM Tomo Suzuki 
wrote:

> Debraj,
>
> I couldn't reproduce the problem in my setting. Netty-common appears as
> test scope.
> https://gist.github.com/suztomo/69f854bddd102b3fe83eae8f0720c494
>
> Would you be willing to create a minimum reproducible project?
> Hopefully it builds only artifacts available on the public Internet (no
> artifactory.arkin.local:8000).
>
> BTW, this is the documentation I think your Maven tree is not behaving as
> documented:
>
> https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#dependency-scope
>
>
>
>
> On Sat, May 23, 2020 at 12:40 AM Debraj Manna 
> wrote:
>
> > Thanks Andy for replying.
> >
> > maven dependency:tree -Dverbose does not seem to work for me. It gives me
> > the below message
> >
> > ...
> > [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
> > [INFO] Verbose not supported since maven-dependency-plugin 3.0
> > [INFO] com.vnera:delete:jar:0.001-SNAPSHOT
> > ...
> >
> > If I just exclude netty-common from apache-bookkeeper then netty-common
> > 4.1.32 does not show up in the dependency tree.
> >
> >
> > On Sat, May 23, 2020 at 3:57 AM Andy Feldman 
> > wrote:
> >
> > > On Fri, May 22, 2020 at 6:31 AM Debraj Manna  >
> > > wrote:
> > >
> > > > bookkeeper-common is in test scope but still netty-common is showing
> up
> > > as
> > > > compile dependency.
> > > >
> > >
> > > Is it possible that netty-common is a transitive dependency of another
> > > dependency as well? Running dependency:tree does not show all paths to
> > each
> > > dependency.
> > >
> > > You can try running dependency:tree with the verbose flag to see more
> > > branches of the tree, although the documentation says it is not
> > guaranteed
> > > to work properly with Maven 3.
> > >
> > >
> >
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
> > >
> > > You can also try removing the dependency on bookkeeper-common and
> running
> > > dependency:tree again to see if netty-common still shows up.
> > >
> > > --
> > > Andy Feldman
> > > Wealthfront
> > >
> >
>
>
> --
> Regards,
> Tomo
>


Re: Maven brings “test” transitive dependency as “compile”

2020-05-22 Thread Debraj Manna
Thanks Andy for replying.

maven dependency:tree -Dverbose does not seem to work for me. It gives me
the below message

...
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
[INFO] Verbose not supported since maven-dependency-plugin 3.0
[INFO] com.vnera:delete:jar:0.001-SNAPSHOT
...

If I just exclude netty-common from apache-bookkeeper then netty-common
4.1.32 does not show up in the dependency tree.


On Sat, May 23, 2020 at 3:57 AM Andy Feldman  wrote:

> On Fri, May 22, 2020 at 6:31 AM Debraj Manna 
> wrote:
>
> > bookkeeper-common is in test scope but still netty-common is showing up
> as
> > compile dependency.
> >
>
> Is it possible that netty-common is a transitive dependency of another
> dependency as well? Running dependency:tree does not show all paths to each
> dependency.
>
> You can try running dependency:tree with the verbose flag to see more
> branches of the tree, although the documentation says it is not guaranteed
> to work properly with Maven 3.
>
> https://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html#verbose
>
> You can also try removing the dependency on bookkeeper-common and running
> dependency:tree again to see if netty-common still shows up.
>
> --
> Andy Feldman
> Wealthfront
>


Re: Maven brings “test” transitive dependency as “compile”

2020-05-22 Thread Debraj Manna
Thanks Tomo for replying.

No I don't have any dependencyManagement specified in my parent pom. I have
placed the effective pom here
<https://gist.github.com/debraj-manna/c1b0debf3f50f5ede32d2e9de68430ac>.

mvn dependency:tree -Dverbose does not work for me. Below is the result I
got.

Am I hitting some known issue in maven ?

dmanna-a01:delete dmanna$ mvn dependency:tree -Dverbose
[INFO] Scanning for projects...
[INFO]

[INFO] Detecting the operating system and CPU architecture
[INFO]

[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.15
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 15
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] --< com.vnera:delete
>--
[INFO] Building delete 0.001-SNAPSHOT
[INFO] [ jar
]-
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ delete ---
*[INFO] Verbose not supported since maven-dependency-plugin 3.0*
[INFO] com.vnera:delete:jar:0.001-SNAPSHOT

On Fri, May 22, 2020 at 7:09 PM Tomo Suzuki 
wrote:

> Hi Debraj,
>
> That's strange. "mvn dependency:tree -Dverbose" gives more information.
>
> "mvn help:effective-pom" may give you some information for netty-comon.
>
> By any change, does the parent (or poms imported by parent) declare
> dependencyManagement for netty-common?
>
>
> On Fri, May 22, 2020 at 9:31 AM Debraj Manna 
> wrote:
>
> > Hi
> >
> > In my project I am observing that maven 3.6.3 is bringing the test
> > transitive dependency as compile. My understanding is that transitive
> > dependency coming from test scope should also have test scope. Can
> someone
> > let me know is my understanding wrong?
> >
> > When I run "mvn dependency:tree" for my project it shows the following:
> >
> > [INFO] \-
> > org.apache.bookkeeper:bookkeeper-common:test-jar:tests:4.10.0:test
> > [INFO]+-
> > org.apache.bookkeeper.stats:bookkeeper-stats-api:jar:4.10.0:test
> > [INFO]+- org.apache.bookkeeper:cpu-affinity:jar:4.10.0:test
> > *[INFO]+- io.netty:netty-common:jar:4.1.32.Final:compile*
> > [INFO]+- org.jctools:jctools-core:jar:2.1.2:test
> > [INFO]+- org.slf4j:slf4j-api:jar:1.7.25:compile
> > [INFO]\- commons-configuration:commons-configuration:jar:1.10:compile
> >
> > bookkeeper-common is in test scope but still netty-common is showing up
> as
> > compile dependency. I have placed the entire dependency tree output here
> > <https://gist.github.com/debraj-manna/dc51aa33d318b41126fb366372997893>.
> >
> > The pom is like below
> >
> > 
> > com.vnera
> > main
> > 0.001-SNAPSHOT
> > 
> >
> > delete
> > jar
> > delete
> >
> > 
> > 
> > com.vnera
> > programs
> > ${main.version}
> > 
> > 
> > com.vnera
> > programs
> > ${main.version}
> > tests
> > test
> > 
> > 
> > com.vnera
> > core-model
> > ${main.version}
> > 
> > 
> > com.vnera
> > storage-utils
> > ${main.version}
> > test-jar
> > test
> > 
> > 
> > com.github.rholder
> > guava-retrying
> > 1.0.5
> > 
> > 
> > com.google.guava
> > guava
> > 
> > 
> > 
> > 
> > 
> >
> >
> > bookkeeper-common is defined in the parent pom as below
> >
> > 
> > org.apache.bookkeeper
> > bookkeeper-common
> > 4.10.0
> > test-jar
> > test
> > 
> >
>
>
> --
> Regards,
> Tomo
>


Maven brings “test” transitive dependency as “compile”

2020-05-22 Thread Debraj Manna
Hi

In my project I am observing that maven 3.6.3 is bringing the test
transitive dependency as compile. My understanding is that transitive
dependency coming from test scope should also have test scope. Can someone
let me know is my understanding wrong?

When I run "mvn dependency:tree" for my project it shows the following:

[INFO] \- org.apache.bookkeeper:bookkeeper-common:test-jar:tests:4.10.0:test
[INFO]+-
org.apache.bookkeeper.stats:bookkeeper-stats-api:jar:4.10.0:test
[INFO]+- org.apache.bookkeeper:cpu-affinity:jar:4.10.0:test
*[INFO]+- io.netty:netty-common:jar:4.1.32.Final:compile*
[INFO]+- org.jctools:jctools-core:jar:2.1.2:test
[INFO]+- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO]\- commons-configuration:commons-configuration:jar:1.10:compile

bookkeeper-common is in test scope but still netty-common is showing up as
compile dependency. I have placed the entire dependency tree output here
<https://gist.github.com/debraj-manna/dc51aa33d318b41126fb366372997893>.

The pom is like below


com.vnera
main
0.001-SNAPSHOT


delete
jar
delete



com.vnera
programs
${main.version}


com.vnera
programs
${main.version}
tests
test


com.vnera
core-model
${main.version}


com.vnera
storage-utils
${main.version}
test-jar
test


com.github.rholder
guava-retrying
1.0.5


com.google.guava
guava







bookkeeper-common is defined in the parent pom as below


org.apache.bookkeeper
bookkeeper-common
4.10.0
test-jar
test



Re: Fail maven multi module build when surefire goes OOM

2020-04-21 Thread Debraj Manna
Anyone any thoughts on this one?

On Sun, Apr 19, 2020 at 10:49 PM Debraj Manna 
wrote:

> Just to add the tests are executed on jenkins so fail-on-end is set to
> true.
>
> On Sun, Apr 19, 2020 at 8:37 PM Debraj Manna 
> wrote:
>
>> We use maven-surefire for executing tests in maven multi-module project.
>> We use fork count of 1. We also specify certain xmx value in surefire
>> configuration.
>>
>> Now when certain module goes OOM during test execution surefire execution
>> of that JVM module terminates but build continue with the execution of
>> tests in other modules.
>>
>> Can someone let me know if it is possible to fail the maven top level
>> build when surefire crashes due to OOM?
>>
>> Note if there is any test assertion failure then I would like to continue
>> with the execution of other tests like it is now, so that I get a complete
>> report of all the test assertion failure in all modules.
>>
>


Re: Fail maven multi module build when surefire goes OOM

2020-04-19 Thread Debraj Manna
Just to add the tests are executed on jenkins so fail-on-end is set to true.

On Sun, Apr 19, 2020 at 8:37 PM Debraj Manna 
wrote:

> We use maven-surefire for executing tests in maven multi-module project.
> We use fork count of 1. We also specify certain xmx value in surefire
> configuration.
>
> Now when certain module goes OOM during test execution surefire execution
> of that JVM module terminates but build continue with the execution of
> tests in other modules.
>
> Can someone let me know if it is possible to fail the maven top level
> build when surefire crashes due to OOM?
>
> Note if there is any test assertion failure then I would like to continue
> with the execution of other tests like it is now, so that I get a complete
> report of all the test assertion failure in all modules.
>


Fail maven multi module build when surefire goes OOM

2020-04-19 Thread Debraj Manna
We use maven-surefire for executing tests in maven multi-module project. We
use fork count of 1. We also specify certain xmx value in surefire
configuration.

Now when certain module goes OOM during test execution surefire execution
of that JVM module terminates but build continue with the execution of
tests in other modules.

Can someone let me know if it is possible to fail the maven top level build
when surefire crashes due to OOM?

Note if there is any test assertion failure then I would like to continue
with the execution of other tests like it is now, so that I get a complete
report of all the test assertion failure in all modules.


Re: Maven Surefire Forked Test Execution in a multimodule project

2020-04-09 Thread Debraj Manna
Thanks Enrico.

On Thu, Apr 9, 2020 at 4:46 PM Enrico Olivelli  wrote:

> Manna
>
> Il Gio 9 Apr 2020, 13:09 Debraj Manna  ha
> scritto:
>
> > Hi
> >
> > I am reading the maven surefire documentation
> > <
> >
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html
> > >
> > about
> > the forked test execution. It states
> >
> > *The default setting is forkCount=1/reuseForks=true, which means that
> > maven-surefire-plugin creates one new JVM process to execute all tests in
> > one Maven module.*
> >
> > *forkCount=1/reuseForks=false executes each test class in its own JVM
> > process, one after another. It creates the highest level of separation
> for
> > the test execution, but it would probably also give you the longest
> > execution time of all the available options. Consider it as a last
> reso*rt.
> >
> >
> > Can someone resolve my below doubts about the above para:
> >
> > In a maven multimodule project if I am setting forkcount=3 /
> > reuseForks=true. Then does that mean maven-surefire-plugin will create 3
> > new JVM processes and then execute tests from 3 modules in 3 JVM and all
> > tests from a module will be running in the same JVM?
> >
>
> No.
> If you want to run parallel execution of modules you have to use -T option
> This is independent from surefire
>
> Enrico
>


Maven Surefire Forked Test Execution in a multimodule project

2020-04-09 Thread Debraj Manna
Hi

I am reading the maven surefire documentation

about
the forked test execution. It states

*The default setting is forkCount=1/reuseForks=true, which means that
maven-surefire-plugin creates one new JVM process to execute all tests in
one Maven module.*

*forkCount=1/reuseForks=false executes each test class in its own JVM
process, one after another. It creates the highest level of separation for
the test execution, but it would probably also give you the longest
execution time of all the available options. Consider it as a last reso*rt.


Can someone resolve my below doubts about the above para:

In a maven multimodule project if I am setting forkcount=3 /
reuseForks=true. Then does that mean maven-surefire-plugin will create 3
new JVM processes and then execute tests from 3 modules in 3 JVM and all
tests from a module will be running in the same JVM?


Re: Skipping maven shade plugin in a spring-boot project based on maven profile

2019-12-20 Thread Debraj Manna
Thanks Maarten.

On Fri, Dec 20, 2019 at 12:07 PM Maarten Mulders  wrote:

> Also cross-posting from StackOverflow [1], where I just answered your
> question:
>
>
> There is a dedicated Spring Boot Maven Plugin [2] that also allows you
> to repackage your application. Its repackage goal automatically
> activates during the package phase, so you don't even need to define an
> execution.
>
> Back to your question, if you want to skip execution of a certain
> plugin, many plugins have a skip property that you can set. The Spring
> Boot Maven Plugin has one. You can set it in the XML configuration, but
> there's also a user property for it. As a result, your dev-local profile
> could look like this:
>
> 
>  dev-local
>  
>  true
>  
> 
>
> But you could even skip the profile completely and invoke Maven with
> -Dspring-boot.repackage.skip=true.
>
> The Maven Shade Plugin [3] has no such property documented, so that
> could be a reason for using the Spring Boot Maven Plugin over the Maven
> Shade Plugin.
>
> Finally, for building applications, you typically don't need mvn clean
> install, but mvn verify would be enough. Saves you a few seconds in
> execution and saves a lot of disk space in the long run since it doesn't
> copy built artifacts to your local Maven repo (~/.m2/repository or
> %userprofile%\.m2\repository).
>
>
> Hope this helps,
>
>
> Maarten
>
> References:
> [1] https://stackoverflow.com/a/59420813/1523342
> [2]
> https://docs.spring.io/spring-boot/docs/current/maven-plugin/index.html
> [3] https://maven.apache.org/plugins/maven-shade-plugin/index.html
>
> On December 20, 2019 at 06:04, Debraj Manna wrote:
>
> > I am cross-posting from stackoverflow
> > <
> https://stackoverflow.com/questions/59393863/skipping-maven-shade-plugin-in-a-spring-boot-project-based-on-maven-profile
> >
> > as I did not get any reply there.
> >
> > I want to skip the execution of maven-shade-plugin when a certain maven
> > profile is activated on a spring-boot project. As mentioned in this
> > answer
> > <https://stackoverflow.com/a/13383092/785523> I have made my pom.xml
> > like
> > below
> >
> >  > 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;>
> > 4.0.0
> >
> > com.van.saasinfra
> > saas-controller
> > 0.001-SNAPSHOT
> > jar
> >
> > saas-controller
> > SaaS Controller
> >
> > 
> > org.springframework.boot
> > spring-boot-starter-parent
> > 1.5.21.RELEASE
> >  
> > 
> >
> > 
> > ...
> > 
> >
> > 
> > 
> > dev-local
> > 
> > org.apache.maven.plugins
> > maven-shade-plugin
> > ${mvn.shade.plugin.version}
> > 
> > 
> > saas-controller-shade
> > none
> > 
> > 
> > 
> > 
> > 
> >
> > 
> > 
> > 
> > maven-shade-plugin
> > 
> > 
> > maven-antrun-plugin
> > 1.8
> > 
> > 
> > generate-sources
> > generate-sources
> > 
> > 
> >  > dir="${project.build.directory}/generated-sources"/>
> > 
> >  > value="--java_out=${project.build.directory}/generated-sources"/>
> >  > value="--proto_path=${project.basedir}/src/main/proto"/>
> >  >
> value="${project.basedir}/src/main/proto/com/van/saasinfra/saascontroller/saas-controller.proto"/>
> >  >
> value="${project.basedir}/src/main/proto/com/van/saasinfra/saascontroller/billing-controller.proto"/>
> >  >
> value="${project.basedir}/src/main/proto/com/van/saasinfra/saascontroller/node-topology.proto"/>
> >  >
> value="${project.basedir}/src/main/proto/com/van/saasinfra/saascontroller/availability.proto"/>
> >  >
> value="${project.basedir}/src/main/proto/com/van/saasinfra/saascontroller/dynamodb-config.proto"/>
> >  >
> value="${project.basedir}/src/main/proto/com/van/saasinfra/saascontroller/tenant-migration.proto"/>
> > 
> > 
> >
> > ${project.build.directory}/generated-sources/
> > 
> > 
> > run
> > 
> > 
> > 
> > 
> > 
> > 
> >
> > But even when doing maven clean install -Pdev-local I am seeing shade
> > step
> > is still getting executed.
> >
> > Can some suggest how to stop the execution of shade when a certain
> > profile
> > is enabled on a spring boot project?
>


Skipping maven shade plugin in a spring-boot project based on maven profile

2019-12-19 Thread Debraj Manna
I am cross-posting from stackoverflow

as I did not get any reply there.

I want to skip the execution of maven-shade-plugin when a certain maven
profile is activated on a spring-boot project. As mentioned in this answer
 I have made my pom.xml like
below

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

com.van.saasinfra
saas-controller
0.001-SNAPSHOT
jar

saas-controller
SaaS Controller


org.springframework.boot
spring-boot-starter-parent
1.5.21.RELEASE
 




...




dev-local

org.apache.maven.plugins
maven-shade-plugin
${mvn.shade.plugin.version}


saas-controller-shade
none









maven-shade-plugin


maven-antrun-plugin
1.8


generate-sources
generate-sources















${project.build.directory}/generated-sources/


run







But even when doing maven clean install -Pdev-local I am seeing shade step
is still getting executed.

Can some suggest how to stop the execution of shade when a certain profile
is enabled on a spring boot project?


Re: Take threaddump on hung surefire tests

2019-12-09 Thread Debraj Manna
Thanks again Tibor.

One more question is it possible to get a thread dump before failing the
build when forkedProcessTimeoutInSeconds
<http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkedProcessTimeoutInSeconds>
is
reached?

On Mon, Dec 9, 2019 at 4:38 PM Tibor Digana  wrote:

>  fixed typo:If your Jenkins sends SIGKILL to the Maven process then enable
> the process checker, see more details in the documentaion:
>
> http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#enableProcessChecker
>
> http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#enableProcessChecker
>
> On Mon, Dec 9, 2019 at 12:01 PM Tibor Digana 
> wrote:
>
> > Hi Debraj,
> >
> > >> to fail the build immediately when timeout is reached
> >
> > This feature exists for years:
> >
> >
> http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#forkedProcessTimeoutInSeconds
> >
> >
> http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#forkedProcessTimeoutInSeconds
> >
> > >> to fail the ... when someone presses abort button on the jenkins
> >
> > This also exists with several alternatives (changed across the versions).
> > See the detailed page
> >
> http://maven.apache.org/surefire/maven-failsafe-plugin/examples/shutdown.html
> >
> > If your Jenkins sends the SIGTERM signal into the Maven process (same as
> > CTRL+C) then the standard input stream in process pipe becomes closed and
> > the EOFException is caugh byt the forked JVM and shutdown is called:
> >
> >
> http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#shutdown
> >
> >
> maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#shutdown
> > If you want to kill the JVM, you can reconfigure the default behavior.
> >
> > If your Jenkins sends SIGTERM to the Maven process then enable the
> process
> > checker, see more details in the documentaion:
> >
> >
> http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#enableProcessChecker
> >
> >
> http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#enableProcessChecker
> >
> > Did it help?
> >
> > Here is the FAQ:
> > http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html
> >
> > Feel free to ask any questions if you have a problem with this topic.
> >
> >
> > Cheers
> > Tibor17
> >
> >
> > On Mon, Dec 9, 2019 at 3:40 AM Debraj Manna 
> > wrote:
> >
> >> No Tibor.  I am not getting much time to spend on this. For new classes
> i
> >> have been using Timeout rule for now.
> >>
> >> One more question in a multi-module project is it possible to fail the
> >> build immediately when timeout is reached and in other failure cases
> fail
> >> in the end. I am using Jenkins so here fail-on-end is set to true. Is it
> >> possible to do this?
> >>
> >>
> >> On Fri, 22 Nov 2019, 02:51 Tibor Digana, 
> wrote:
> >>
> >> > Hi Debraj,
> >> >
> >> > It's over one month when you wrote this email.
> >> > How did you solve this issue, did you find the real root cause?
> >> > Let us know how you are doing, thx!
> >> > btw, we released the new version 3.0.0-M4 in Nov/17.
> >> >
> >> > Cheers
> >> > Tibor17
> >> >
> >> >
> >> >
> >> > On Thu, Oct 3, 2019 at 2:49 PM Debraj Manna  >
> >> > wrote:
> >> >
> >> > > Sometimes I have maven surefire tests that get hung, due to either
> >> races
> >> > or
> >> > > deadlocks.
> >> > >
> >> > > When this happens I have to discover what slave is being used, and
> >> then I
> >> > > have to log on that slave, sudo to jenkins account and execute
> either
> >> > > jstack or kill -3
> >> > >
> >> > > I am looking for a simple solution like doing jstack / kill -3 when
> >> > someone
> >> > > presses abort button on the jenkins.
> >> > >
> >> > > Can someone suggest how can I automate this or some better way of
> >> > handling
> >> > > this?
> >> > >
> >> >
> >>
> >
>


Re: Take threaddump on hung surefire tests

2019-12-08 Thread Debraj Manna
No Tibor.  I am not getting much time to spend on this. For new classes i
have been using Timeout rule for now.

One more question in a multi-module project is it possible to fail the
build immediately when timeout is reached and in other failure cases fail
in the end. I am using Jenkins so here fail-on-end is set to true. Is it
possible to do this?


On Fri, 22 Nov 2019, 02:51 Tibor Digana,  wrote:

> Hi Debraj,
>
> It's over one month when you wrote this email.
> How did you solve this issue, did you find the real root cause?
> Let us know how you are doing, thx!
> btw, we released the new version 3.0.0-M4 in Nov/17.
>
> Cheers
> Tibor17
>
>
>
> On Thu, Oct 3, 2019 at 2:49 PM Debraj Manna 
> wrote:
>
> > Sometimes I have maven surefire tests that get hung, due to either races
> or
> > deadlocks.
> >
> > When this happens I have to discover what slave is being used, and then I
> > have to log on that slave, sudo to jenkins account and execute either
> > jstack or kill -3
> >
> > I am looking for a simple solution like doing jstack / kill -3 when
> someone
> > presses abort button on the jenkins.
> >
> > Can someone suggest how can I automate this or some better way of
> handling
> > this?
> >
>


Re: Take threaddump on hung surefire tests

2019-10-05 Thread Debraj Manna
Thanks Tibor. It is clear now.

On Sat 5 Oct, 2019, 9:36 PM Tibor Digana,  wrote:

> pleaseStop() can be called only inside Surefire.
> So your solution has to be embedded in Surefire and the feature has to
> configured.
> Unfortunately it's by design of JUnit.
> RunNotifier cannot be exposed because it must be only one instance and we
> need to instantiate it and have it under the control in Surefire.
> Therefore this feature has to be internal and implement a hook between
> RunListener and RunNotifier which already exists in Surefire.
> This is the support I was talking about in one of my previous emails.
>
> T
>
> On Sat, Oct 5, 2019 at 5:57 PM Debraj Manna 
> wrote:
>
> > Enrico apache-bookeeper seems to be using timeout in @Test as I can see
> > from their github repo here
> > <
> >
> https://github.com/apache/bookkeeper/search?q=%40Test%28timeout+%3D_q=%40Test%28timeout+%3D
> > >
> > .
> >
> > Tibor how can I pass an instance of RunNotifier to a class extending from
> > RunListener so that I can call pleaseStop() from the listener when the
> > timeout of a test expires? Is there any example code I can refer to?
> >
> > I am using Junit 4.12 and maven-surefire 2.22.2
> >
> > On Sat, Oct 5, 2019 at 6:27 PM Tibor Digana 
> > wrote:
> >
> > > Some users may have a requirement to stop the exertion when a test
> hangs.
> > > Other users woul maybe prefer to interrupt the test and continue with
> > next
> > > test.
> > > This would lead to configuration with more than one config value =>
> POJO
> > in
> > > new config parameter.
> > >
> > > On Sat, Oct 5, 2019 at 2:17 PM Debraj Manna 
> > > wrote:
> > >
> > > > Thanks again Enrico. I will try to find out from apache-bookmark code
> > or
> > > > check in apache-bookkeper mailing list.
> > > >
> > > > Yes Tibor I am looking for a global timeout without explicitly adding
> > the
> > > > timeout annotation in all of my tests / classes. I am not using
> > > forkCount >
> > > > 1. I get your testStarted part but it is still not clear to me about
> > > > calling 'pleaseStop() on the listener'. Are you suggesting to add
> this
> > in
> > > > each of my test classes? Can you explain this a bit more?
> > > >
> > > > On Fri, Oct 4, 2019 at 11:52 PM Tibor Digana  >
> > > > wrote:
> > > >
> > > > > Hi Debraj,
> > > > >
> > > > > It depends on your requirements.
> > > > >
> > > > > As I initially understood your email, every test method wants to
> have
> > > > > implicit timeout value even without the annotation @Timeout.
> > > > > Then the testStarted is important event even your code will see
> when
> > > the
> > > > > test method has started and timeout can be easily computed.
> > > > > Of course you need to use an extra thread which checks the end
> > events.
> > > > >
> > > > >
> > > >
> > >
> >
> https://junit.org/junit4/javadoc/4.12/org/junit/runner/notification/RunListener.html#testStarted(org.junit.runner.Description)
> > > > > Your code can call the method "pleaseStop()" on the listener. I
> think
> > > it
> > > > > would not be reliable algorithm in all use cases if you use
> forkCount
> > > > 1
> > > > > and there you will need to have our support.
> > > > >
> > > > > Is it this what you need, the global timeout with the same value on
> > > every
> > > > > test method?
> > > > >
> > > > > Cheers
> > > > > Tibor
> > > > >
> > > > > On Fri, Oct 4, 2019 at 4:30 PM Debraj Manna <
> > subharaj.ma...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Enrico
> > > > > >
> > > > > > If I get the approach correctly then all my junit4 tests should
> > have
> > > > > > timeout specified (either via @Test or via @Rule) then only I can
> > use
> > > > the
> > > > > > listener. But the problem is we are having more than 2000 tests
> and
> > > > > > specifying a timeout in each of the tests/classes is cumbersome.
> > > > > >
> > > > > > Correct me if I have misunderstood anything.
> > > > > >
> > &

Re: Take threaddump on hung surefire tests

2019-10-05 Thread Debraj Manna
Enrico apache-bookeeper seems to be using timeout in @Test as I can see
from their github repo here
<https://github.com/apache/bookkeeper/search?q=%40Test%28timeout+%3D_q=%40Test%28timeout+%3D>
.

Tibor how can I pass an instance of RunNotifier to a class extending from
RunListener so that I can call pleaseStop() from the listener when the
timeout of a test expires? Is there any example code I can refer to?

I am using Junit 4.12 and maven-surefire 2.22.2

On Sat, Oct 5, 2019 at 6:27 PM Tibor Digana  wrote:

> Some users may have a requirement to stop the exertion when a test hangs.
> Other users woul maybe prefer to interrupt the test and continue with next
> test.
> This would lead to configuration with more than one config value => POJO in
> new config parameter.
>
> On Sat, Oct 5, 2019 at 2:17 PM Debraj Manna 
> wrote:
>
> > Thanks again Enrico. I will try to find out from apache-bookmark code or
> > check in apache-bookkeper mailing list.
> >
> > Yes Tibor I am looking for a global timeout without explicitly adding the
> > timeout annotation in all of my tests / classes. I am not using
> forkCount >
> > 1. I get your testStarted part but it is still not clear to me about
> > calling 'pleaseStop() on the listener'. Are you suggesting to add this in
> > each of my test classes? Can you explain this a bit more?
> >
> > On Fri, Oct 4, 2019 at 11:52 PM Tibor Digana 
> > wrote:
> >
> > > Hi Debraj,
> > >
> > > It depends on your requirements.
> > >
> > > As I initially understood your email, every test method wants to have
> > > implicit timeout value even without the annotation @Timeout.
> > > Then the testStarted is important event even your code will see when
> the
> > > test method has started and timeout can be easily computed.
> > > Of course you need to use an extra thread which checks the end events.
> > >
> > >
> >
> https://junit.org/junit4/javadoc/4.12/org/junit/runner/notification/RunListener.html#testStarted(org.junit.runner.Description)
> > > Your code can call the method "pleaseStop()" on the listener. I think
> it
> > > would not be reliable algorithm in all use cases if you use forkCount
> > 1
> > > and there you will need to have our support.
> > >
> > > Is it this what you need, the global timeout with the same value on
> every
> > > test method?
> > >
> > > Cheers
> > > Tibor
> > >
> > > On Fri, Oct 4, 2019 at 4:30 PM Debraj Manna 
> > > wrote:
> > >
> > > > Enrico
> > > >
> > > > If I get the approach correctly then all my junit4 tests should have
> > > > timeout specified (either via @Test or via @Rule) then only I can use
> > the
> > > > listener. But the problem is we are having more than 2000 tests and
> > > > specifying a timeout in each of the tests/classes is cumbersome.
> > > >
> > > > Correct me if I have misunderstood anything.
> > > >
> > > >
> > > >
> > > > On Fri, Oct 4, 2019 at 3:18 PM Debraj Manna <
> subharaj.ma...@gmail.com>
> > > > wrote:
> > > >
> > > > > Yeah sure ... thanks.
> > > > >
> > > > > On Thu, Oct 3, 2019 at 7:50 PM Tibor Digana <
> tibordig...@apache.org>
> > > > > wrote:
> > > > >
> > > > >> Hi Debraj,
> > > > >>
> > > > >> There is nice technical idea from Enrico.
> > > > >> If you apply it and you are convinced that it would work properly
> > for
> > > > all
> > > > >> the Java community, feel free to show it and we can discuss it on
> > how
> > > we
> > > > >> would adopt your solution in Surefire project.
> > > > >>
> > > > >> Cheers
> > > > >> Tibor17
> > > > >>
> > > > >> On Thu, Oct 3, 2019 at 2:49 PM Debraj Manna <
> > subharaj.ma...@gmail.com
> > > >
> > > > >> wrote:
> > > > >>
> > > > >> > Sometimes I have maven surefire tests that get hung, due to
> either
> > > > >> races or
> > > > >> > deadlocks.
> > > > >> >
> > > > >> > When this happens I have to discover what slave is being used,
> and
> > > > then
> > > > >> I
> > > > >> > have to log on that slave, sudo to jenkins account and execute
> > > either
> > > > >> > jstack or kill -3
> > > > >> >
> > > > >> > I am looking for a simple solution like doing jstack / kill -3
> > when
> > > > >> someone
> > > > >> > presses abort button on the jenkins.
> > > > >> >
> > > > >> > Can someone suggest how can I automate this or some better way
> of
> > > > >> handling
> > > > >> > this?
> > > > >> >
> > > > >>
> > > > >
> > > >
> > >
> >
>


Re: Take threaddump on hung surefire tests

2019-10-05 Thread Debraj Manna
Thanks again Enrico. I will try to find out from apache-bookmark code or
check in apache-bookkeper mailing list.

Yes Tibor I am looking for a global timeout without explicitly adding the
timeout annotation in all of my tests / classes. I am not using forkCount >
1. I get your testStarted part but it is still not clear to me about
calling 'pleaseStop() on the listener'. Are you suggesting to add this in
each of my test classes? Can you explain this a bit more?

On Fri, Oct 4, 2019 at 11:52 PM Tibor Digana  wrote:

> Hi Debraj,
>
> It depends on your requirements.
>
> As I initially understood your email, every test method wants to have
> implicit timeout value even without the annotation @Timeout.
> Then the testStarted is important event even your code will see when the
> test method has started and timeout can be easily computed.
> Of course you need to use an extra thread which checks the end events.
>
> https://junit.org/junit4/javadoc/4.12/org/junit/runner/notification/RunListener.html#testStarted(org.junit.runner.Description)
> Your code can call the method "pleaseStop()" on the listener. I think it
> would not be reliable algorithm in all use cases if you use forkCount > 1
> and there you will need to have our support.
>
> Is it this what you need, the global timeout with the same value on every
> test method?
>
> Cheers
> Tibor
>
> On Fri, Oct 4, 2019 at 4:30 PM Debraj Manna 
> wrote:
>
> > Enrico
> >
> > If I get the approach correctly then all my junit4 tests should have
> > timeout specified (either via @Test or via @Rule) then only I can use the
> > listener. But the problem is we are having more than 2000 tests and
> > specifying a timeout in each of the tests/classes is cumbersome.
> >
> > Correct me if I have misunderstood anything.
> >
> >
> >
> > On Fri, Oct 4, 2019 at 3:18 PM Debraj Manna 
> > wrote:
> >
> > > Yeah sure ... thanks.
> > >
> > > On Thu, Oct 3, 2019 at 7:50 PM Tibor Digana 
> > > wrote:
> > >
> > >> Hi Debraj,
> > >>
> > >> There is nice technical idea from Enrico.
> > >> If you apply it and you are convinced that it would work properly for
> > all
> > >> the Java community, feel free to show it and we can discuss it on how
> we
> > >> would adopt your solution in Surefire project.
> > >>
> > >> Cheers
> > >> Tibor17
> > >>
> > >> On Thu, Oct 3, 2019 at 2:49 PM Debraj Manna  >
> > >> wrote:
> > >>
> > >> > Sometimes I have maven surefire tests that get hung, due to either
> > >> races or
> > >> > deadlocks.
> > >> >
> > >> > When this happens I have to discover what slave is being used, and
> > then
> > >> I
> > >> > have to log on that slave, sudo to jenkins account and execute
> either
> > >> > jstack or kill -3
> > >> >
> > >> > I am looking for a simple solution like doing jstack / kill -3 when
> > >> someone
> > >> > presses abort button on the jenkins.
> > >> >
> > >> > Can someone suggest how can I automate this or some better way of
> > >> handling
> > >> > this?
> > >> >
> > >>
> > >
> >
>


Re: Take threaddump on hung surefire tests

2019-10-04 Thread Debraj Manna
Enrico

If I get the approach correctly then all my junit4 tests should have
timeout specified (either via @Test or via @Rule) then only I can use the
listener. But the problem is we are having more than 2000 tests and
specifying a timeout in each of the tests/classes is cumbersome.

Correct me if I have misunderstood anything.



On Fri, Oct 4, 2019 at 3:18 PM Debraj Manna 
wrote:

> Yeah sure ... thanks.
>
> On Thu, Oct 3, 2019 at 7:50 PM Tibor Digana 
> wrote:
>
>> Hi Debraj,
>>
>> There is nice technical idea from Enrico.
>> If you apply it and you are convinced that it would work properly for all
>> the Java community, feel free to show it and we can discuss it on how we
>> would adopt your solution in Surefire project.
>>
>> Cheers
>> Tibor17
>>
>> On Thu, Oct 3, 2019 at 2:49 PM Debraj Manna 
>> wrote:
>>
>> > Sometimes I have maven surefire tests that get hung, due to either
>> races or
>> > deadlocks.
>> >
>> > When this happens I have to discover what slave is being used, and then
>> I
>> > have to log on that slave, sudo to jenkins account and execute either
>> > jstack or kill -3
>> >
>> > I am looking for a simple solution like doing jstack / kill -3 when
>> someone
>> > presses abort button on the jenkins.
>> >
>> > Can someone suggest how can I automate this or some better way of
>> handling
>> > this?
>> >
>>
>


Re: Take threaddump on hung surefire tests

2019-10-04 Thread Debraj Manna
Yeah sure ... thanks.

On Thu, Oct 3, 2019 at 7:50 PM Tibor Digana  wrote:

> Hi Debraj,
>
> There is nice technical idea from Enrico.
> If you apply it and you are convinced that it would work properly for all
> the Java community, feel free to show it and we can discuss it on how we
> would adopt your solution in Surefire project.
>
> Cheers
> Tibor17
>
> On Thu, Oct 3, 2019 at 2:49 PM Debraj Manna 
> wrote:
>
> > Sometimes I have maven surefire tests that get hung, due to either races
> or
> > deadlocks.
> >
> > When this happens I have to discover what slave is being used, and then I
> > have to log on that slave, sudo to jenkins account and execute either
> > jstack or kill -3
> >
> > I am looking for a simple solution like doing jstack / kill -3 when
> someone
> > presses abort button on the jenkins.
> >
> > Can someone suggest how can I automate this or some better way of
> handling
> > this?
> >
>


Take threaddump on hung surefire tests

2019-10-03 Thread Debraj Manna
Sometimes I have maven surefire tests that get hung, due to either races or
deadlocks.

When this happens I have to discover what slave is being used, and then I
have to log on that slave, sudo to jenkins account and execute either
jstack or kill -3

I am looking for a simple solution like doing jstack / kill -3 when someone
presses abort button on the jenkins.

Can someone suggest how can I automate this or some better way of handling
this?


Re: How to add test-jar and jar as dependency in a maven multimodule project?

2019-09-12 Thread Debraj Manna
Anyone any thoughts on this?

I have posted the same in stackoverflow
<https://stackoverflow.com/questions/57891875/how-to-add-test-jar-and-jar-as-dependency-in-a-maven-multimodule-project>
also with a lot more details. But did not get much help there also.

On Wed, Sep 11, 2019 at 8:30 PM Debraj Manna 
wrote:

> I have a maven multimodule project of the form
>
> - main
>   - storage
>  - storage-config
>  - storage-utils
>  - storage-common
> - tools
>
> I have a class `com.vnera.storage.config.Embedded.java` residing under
> test folder in `storage-config` which I want to use in `storage-utils`
> under `test` scope. `storage-utils` also needs `storage-config` in main
> phase.
>
> I have added the below section in `storage-config` pom and I am seeing
> `test-jar` of `storage-config` is getting generated.
>
> 
> org.apache.maven.plugins
> maven-jar-plugin
> 2.4
> 
> 
> 
> test-jar
> 
> 
> 
> 
>
> `storage-utils` pom looks like below
>
> 
> 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
>
> 
> com.vnera
> storage
> 0.001-SNAPSHOT
> 
>
> jar
> storage-utils
> utils
>
> 
> 
> com.github.fge
> json-patch
> 1.9
> 
> 
> com.vnera
> storage-config
> ${main.version}
> 
> 
> com.vnera
> storage-config
> ${main.version}
> test-jar
> test
> 
> 
> 
> 
> 
> org.apache.maven.plugins
> maven-surefire-plugin
> ${mvn.surefire.plugin.version}
> 
> true
> 
> 
> 
> org.apache.maven.surefire
> surefire-junit47
>
> ${mvn.surefire.plugin.version}
> 
> 
> 
> 
> org.apache.maven.plugins
> maven-jar-plugin
> 2.4
> 
> 
> 
> test-jar
> 
> 
> 
> 
> 
> 
> 
>
> My compilation is running fine. But whenever I am trying to access
>  `Embedded.java` from a class in `storage-utils` in `test` scope. I am
> getting `NoClassDefFoundError` for `Embedded.java`.
>
> Can someone let me know what is going wrong and how can I solve this?
>
> Maven Version - 3.5.3
>


How to add test-jar and jar as dependency in a maven multimodule project?

2019-09-11 Thread Debraj Manna
I have a maven multimodule project of the form

- main
  - storage
 - storage-config
 - storage-utils
 - storage-common
- tools

I have a class `com.vnera.storage.config.Embedded.java` residing under test
folder in `storage-config` which I want to use in `storage-utils` under
`test` scope. `storage-utils` also needs `storage-config` in main phase.

I have added the below section in `storage-config` pom and I am seeing
`test-jar` of `storage-config` is getting generated.


org.apache.maven.plugins
maven-jar-plugin
2.4



test-jar





`storage-utils` pom looks like below


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


com.vnera
storage
0.001-SNAPSHOT


jar
storage-utils
utils



com.github.fge
json-patch
1.9


com.vnera
storage-config
${main.version}


com.vnera
storage-config
${main.version}
test-jar
test





org.apache.maven.plugins
maven-surefire-plugin
${mvn.surefire.plugin.version}

true



org.apache.maven.surefire
surefire-junit47

${mvn.surefire.plugin.version}




org.apache.maven.plugins
maven-jar-plugin
2.4



test-jar








My compilation is running fine. But whenever I am trying to access
 `Embedded.java` from a class in `storage-utils` in `test` scope. I am
getting `NoClassDefFoundError` for `Embedded.java`.

Can someone let me know what is going wrong and how can I solve this?

Maven Version - 3.5.3


Re: Shade Plugin dependency resolution

2019-08-23 Thread Debraj Manna
Anyone any update on this?


On Thu, Aug 22, 2019 at 8:06 PM Debraj Manna 
wrote:

> Hi
>
> Is there any doc or link that explains how does shade Plugin resolves the
> dependency that is to be added in the uber jar?
>


Shade Plugin dependency resolution

2019-08-22 Thread Debraj Manna
Hi

Is there any doc or link that explains how does shade Plugin resolves the
dependency that is to be added in the uber jar?


Re: Maven local repo in a common global directory for multiple parallel execution

2019-05-27 Thread Debraj Manna
Yes disk required will be more .

I don't have a requirement where one of my projects requires artifact
created by another. So I can use a common local repo for all parallel
executions?

On Mon, May 27, 2019 at 11:34 AM Golan, Yaron 
wrote:

> Please remember that you need much bigger disk space as you are
> duplicating binaries.
>
>
> -Original Message-
> From: Debraj Manna 
> Sent: Sunday, May 26, 2019 4:49 PM
> To: Maven Users List 
> Subject: Maven local repo in a common global directory for multiple
> parallel execution
>
> I have a machine in which multiple parallel maven execution happen . Each
> execution executes the below command in a seperate workspace directory
>
> mvn -f main/pom.xml clean package -DskipTests -T 6
>
> Can someone let me know should I use a seperate maven local repo path (
> -Dmaven.repo.local=$MAVEN_REPO) for each execution or I can use a common
> .m2 directory for all parallel runs? What is the best practice?
>
>
>- Maven Version 3.5
>- Java 8
>


Re: Maven local repo in a common global directory for multiple parallel execution

2019-05-26 Thread Debraj Manna
Yes it is jenkins.

Can you please explain why do you suggest to use separate caches / local
repo for each execution?

On Sun, May 26, 2019 at 7:26 PM Karl Heinz Marbaise 
wrote:

> Hi,
> On 26.05.19 15:48, Debraj Manna wrote:
> > I have a machine in which multiple parallel maven execution happen . Each
> > execution executes the below command in a seperate workspace directory
>
> Kind of a build server with a CI solution like Jenkins?
>
> >
> > mvn -f main/pom.xml clean package -DskipTests -T 6
>
> Why using "-f main/pom.xml" ?
>
>
> >
> > Can someone let me know should I use a seperate maven local repo path (
> > -Dmaven.repo.local=$MAVEN_REPO) for each execution or I can use a common
> .m2
> > directory for all parallel runs? What is the best practice?
>
> I can recommend to use separate caches for each execution..
>
>
> >
> >
> > - Maven Version 3.5
>
> I would suggest to upgrade to most recent Maven version.. Also define
> all versions of all plugins in your build...
>
> Kind regards
> Karl Heinz Marbaise
>
> > - Java 8
> >
>


Maven local repo in a common global directory for multiple parallel execution

2019-05-26 Thread Debraj Manna
I have a machine in which multiple parallel maven execution happen . Each
execution executes the below command in a seperate workspace directory

mvn -f main/pom.xml clean package -DskipTests -T 6

Can someone let me know should I use a seperate maven local repo path (
-Dmaven.repo.local=$MAVEN_REPO) for each execution or I can use a common .m2
directory for all parallel runs? What is the best practice?


   - Maven Version 3.5
   - Java 8


Re: Maven 3 fails to follow 301 redirects

2019-03-17 Thread Debraj Manna
Can you let me know how can I determine which wagon plugin maven 3.5 is
referencing?

On Tue, Mar 12, 2019 at 1:15 AM Anthony Whitford 
wrote:

> Which Wagon or Plugin (and version) specifically is running into a problem?
>
> This issue appears to be resolved in wagon 2.0 — could you be referencing
> an old plugin/wagon despite using Maven 3.5?
>
>
> > On Mar 11, 2019, at 12:23 PM, Debraj Manna 
> wrote:
> >
> > Anyone any thoughts on this?
> >
> >
> > On Fri, Mar 8, 2019 at 12:12 PM Debraj Manna 
> > wrote:
> >
> >> Hi
> >>
> >> I can see an issue filed for "Maven 3 fails to follow 301 redirects"
> >> https://issues.apache.org/jira/browse/MNG-4816.
> >>
> >> Can someone let me know in which version of maven 3.x this is fixed as I
> >> am observing the issue with Maven 3.5 also?
> >>
> >> Thanks,
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: Maven 3 fails to follow 301 redirects

2019-03-11 Thread Debraj Manna
Anyone any thoughts on this?


On Fri, Mar 8, 2019 at 12:12 PM Debraj Manna 
wrote:

> Hi
>
> I can see an issue filed for "Maven 3 fails to follow 301 redirects"
> https://issues.apache.org/jira/browse/MNG-4816.
>
> Can someone let me know in which version of maven 3.x this is fixed as I
> am observing the issue with Maven 3.5 also?
>
> Thanks,
>


Maven 3 fails to follow 301 redirects

2019-03-07 Thread Debraj Manna
Hi

I can see an issue filed for "Maven 3 fails to follow 301 redirects"
https://issues.apache.org/jira/browse/MNG-4816.

Can someone let me know in which version of maven 3.x this is fixed as I am
observing the issue with Maven 3.5 also?

Thanks,


Identify large size dependencies in a fat jar created using maven

2019-02-20 Thread Debraj Manna
I have a fat jar created using maven 3.5.

I am trying to reduce the size of fat jar. Can someone let me know how I
can determine the size of the larger dependencies? If a dependency A brings
in B & C . Then the size of A should be the sum of the size of A, B & C.

Is there a way to do this in maven 3.5 ?


How can I prevent SLF4J's infamous “multiple bindings” warning at build time for maven build?

2018-04-11 Thread Debraj Manna
I have seen a similar question being answered in stackoverflow

https://stackoverflow.com/questions/25335497/how-can-i-prevent-slf4js-infamous-multiple-bindings-warning-at-build-time

Is it possible achieve something like this via maven build also ?


Re: Avoid guava version conflict with hbase by shading

2018-01-21 Thread Debraj Manna
Mark

One more query if some other dependency (let's say elasticsearch for
example) leaks its usage of guava then it may happen I end up again with
two incompatible versions of guava. What is the recommended way of handling
this?

Thanks,


On Sun, Jan 21, 2018 at 3:19 AM, Mark Prins <mc.pr...@gmail.com> wrote:

> That's the idea, you cannot otherwise control which classes or which
> version of guava are loaded by the classloader at runtime.
>
> Op 20 jan. 2018 14:55 schreef "Debraj Manna" <subharaj.ma...@gmail.com>:
>
> Ok. But then I think I have to change the import of guava in all the places
> in my code?
>
> On Sat, Jan 20, 2018 at 1:44 PM, Mark Prins <mc.pr...@gmail.com> wrote:
>
> > You could try shading the new guava to a different package and use that
> in
> > your code.
> > E.g. jena-shaded-guava does that
> >
> > Op 20 jan. 2018 09:02 schreef "Debraj Manna" <subharaj.ma...@gmail.com>:
> >
> > > Mark
> > >
> > > hbase and hadoop is using the old guava. Is there a way I can use the
> > > latest guava in my code and let hadoop and hbase use the old guava.
> > >
> > > On 20-Jan-2018 1:19 PM, "Mark Prins" <mc.pr...@gmail.com> wrote:
> > >
> > > > It seems that the guava versions are not API compatible, so shading
> is
> > > > unlikely to help. You will need to downgrade to a compatible version
> of
> > > > guava or get the other projects to upgrade.
> > > > -M
> > > >
> > > > Op 20 jan. 2018 07:51 schreef "Debraj Manna" <
> subharaj.ma...@gmail.com
> > >:
> > > >
> > > > I have posted more details in stackoverflow
> > > > <https://stackoverflow.com/questions/48140339/guava-23-5-
> > > > conflict-with-hbase-testing-util-1-2>.
> > > > I could not add all the details here because of size limitation.
> > > >
> > > > In a project I am using Guava 23.5 but some of the dependencies
> > (hadoop &
> > > > hbase) are using old Guava 14. This is causing an exception during
> > > runtime
> > > >
> > > > As mentioned here <https://www.elastic.co/blog/
> > to-shade-or-not-to-shade>
> > > I
> > > > tried to shade the Hbase dependency in a new module named shadedcdh.
> > > > pom.xml
> > > > looks like below
> > > >
> > > > ?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > 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;>
> > > > 
> > > > main
> > > > com.vnera
> > > > 0.001-SNAPSHOT
> > > > 
> > > > 4.0.0
> > > >
> > > > shaded-cdh
> > > > jar
> > > >
> > > > 
> > > > 
> > > > org.apache.hbase
> > > > hbase-testing-util
> > > > 1.2.0-cdh5.7.0
> > > > 
> > > > 
> > > > org.apache.hadoop
> > > > hadoop-client
> > > > ${hadoop.version}
> > > > 
> > > > 
> > > > org.apache.hadoop
> > > > hadoop-common
> > > > ${hadoop.version}
> > > > 
> > > > 
> > > > org.apache.hbase
> > > > hbase-client
> > > > 
> > > > 1.2.0-cdh5.7.0
> > > > 
> > > > 
> > > >
> > > > 
> > > > 
> > > > 
> > > > org.apache.maven.plugins
> > > > maven-shade-plugin
> > > > 2.4.1
> > > > 
> > > > 
> > > > package
> > > > 
> > > > shade
> > > > 
> > > > 
> > > > 
> > > > 
> > > > com.google.common > pattern>
> > > >
> > > > shaded.com.google.common
> > > > 
> > > > 
> > > > 
> > > >  > > > implementation="org.apache.maven.plugins.shade.resource.
> > > > ManifestResourceTransformer"
> > > > />
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > 
> > > > 
> > > > cloudera
> > > > https://repository.cloudera.com/artifactory/
> > > > cloudera-repos/
> > > > 
> > > > 
> > > > 
> > > > 
> > > >
> > > > I excluded hbase and hadoop dependency from my project and added
> > > > shadedcdh as dependency. But this is still giving me the same
> > > > exception. The dependency tree I have posted in the stackoverflow. I
> > > > could not post here because of size limitation. Can someone let me
> > > > know how can I avoid the conflict?
> > > >
> > >
> >
>


Re: Avoid guava version conflict with hbase by shading

2018-01-20 Thread Debraj Manna
Ok. But then I think I have to change the import of guava in all the places
in my code?

On Sat, Jan 20, 2018 at 1:44 PM, Mark Prins <mc.pr...@gmail.com> wrote:

> You could try shading the new guava to a different package and use that in
> your code.
> E.g. jena-shaded-guava does that
>
> Op 20 jan. 2018 09:02 schreef "Debraj Manna" <subharaj.ma...@gmail.com>:
>
> > Mark
> >
> > hbase and hadoop is using the old guava. Is there a way I can use the
> > latest guava in my code and let hadoop and hbase use the old guava.
> >
> > On 20-Jan-2018 1:19 PM, "Mark Prins" <mc.pr...@gmail.com> wrote:
> >
> > > It seems that the guava versions are not API compatible, so shading is
> > > unlikely to help. You will need to downgrade to a compatible version of
> > > guava or get the other projects to upgrade.
> > > -M
> > >
> > > Op 20 jan. 2018 07:51 schreef "Debraj Manna" <subharaj.ma...@gmail.com
> >:
> > >
> > > I have posted more details in stackoverflow
> > > <https://stackoverflow.com/questions/48140339/guava-23-5-
> > > conflict-with-hbase-testing-util-1-2>.
> > > I could not add all the details here because of size limitation.
> > >
> > > In a project I am using Guava 23.5 but some of the dependencies
> (hadoop &
> > > hbase) are using old Guava 14. This is causing an exception during
> > runtime
> > >
> > > As mentioned here <https://www.elastic.co/blog/
> to-shade-or-not-to-shade>
> > I
> > > tried to shade the Hbase dependency in a new module named shadedcdh.
> > > pom.xml
> > > looks like below
> > >
> > > ?xml version="1.0" encoding="UTF-8"?>
> > >
> > > 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;>
> > > 
> > > main
> > > com.vnera
> > > 0.001-SNAPSHOT
> > > 
> > > 4.0.0
> > >
> > > shaded-cdh
> > > jar
> > >
> > > 
> > > 
> > > org.apache.hbase
> > > hbase-testing-util
> > > 1.2.0-cdh5.7.0
> > > 
> > > 
> > > org.apache.hadoop
> > > hadoop-client
> > > ${hadoop.version}
> > > 
> > > 
> > > org.apache.hadoop
> > > hadoop-common
> > > ${hadoop.version}
> > > 
> > > 
> > > org.apache.hbase
> > > hbase-client
> > > 
> > > 1.2.0-cdh5.7.0
> > > 
> > > 
> > >
> > > 
> > > 
> > > 
> > > org.apache.maven.plugins
> > > maven-shade-plugin
> > > 2.4.1
> > > 
> > > 
> > > package
> > > 
> > > shade
> > > 
> > > 
> > > 
> > > 
> > > com.google.common pattern>
> > >
> > > shaded.com.google.common
> > > 
> > > 
> > > 
> > >  > > implementation="org.apache.maven.plugins.shade.resource.
> > > ManifestResourceTransformer"
> > > />
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> > > 
> > > 
> > > cloudera
> > > https://repository.cloudera.com/artifactory/
> > > cloudera-repos/
> > > 
> > > 
> > > 
> > > 
> > >
> > > I excluded hbase and hadoop dependency from my project and added
> > > shadedcdh as dependency. But this is still giving me the same
> > > exception. The dependency tree I have posted in the stackoverflow. I
> > > could not post here because of size limitation. Can someone let me
> > > know how can I avoid the conflict?
> > >
> >
>


Re: Avoid guava version conflict with hbase by shading

2018-01-20 Thread Debraj Manna
Mark

hbase and hadoop is using the old guava. Is there a way I can use the
latest guava in my code and let hadoop and hbase use the old guava.

On 20-Jan-2018 1:19 PM, "Mark Prins" <mc.pr...@gmail.com> wrote:

> It seems that the guava versions are not API compatible, so shading is
> unlikely to help. You will need to downgrade to a compatible version of
> guava or get the other projects to upgrade.
> -M
>
> Op 20 jan. 2018 07:51 schreef "Debraj Manna" <subharaj.ma...@gmail.com>:
>
> I have posted more details in stackoverflow
> <https://stackoverflow.com/questions/48140339/guava-23-5-
> conflict-with-hbase-testing-util-1-2>.
> I could not add all the details here because of size limitation.
>
> In a project I am using Guava 23.5 but some of the dependencies (hadoop &
> hbase) are using old Guava 14. This is causing an exception during runtime
>
> As mentioned here <https://www.elastic.co/blog/to-shade-or-not-to-shade> I
> tried to shade the Hbase dependency in a new module named shadedcdh.
> pom.xml
> looks like below
>
> ?xml version="1.0" encoding="UTF-8"?>
>
> 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;>
> 
> main
> com.vnera
> 0.001-SNAPSHOT
> 
> 4.0.0
>
> shaded-cdh
> jar
>
> 
> 
> org.apache.hbase
> hbase-testing-util
> 1.2.0-cdh5.7.0
> 
> 
> org.apache.hadoop
> hadoop-client
> ${hadoop.version}
> 
> 
> org.apache.hadoop
> hadoop-common
> ${hadoop.version}
> 
> 
> org.apache.hbase
> hbase-client
> 
> 1.2.0-cdh5.7.0
> 
> 
>
> 
> 
> 
> org.apache.maven.plugins
> maven-shade-plugin
> 2.4.1
> 
> 
> package
> 
> shade
> 
> 
> 
> 
> com.google.common
>
> shaded.com.google.common
> 
> 
> 
>  implementation="org.apache.maven.plugins.shade.resource.
> ManifestResourceTransformer"
> />
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> cloudera
> https://repository.cloudera.com/artifactory/
> cloudera-repos/
> 
> 
> 
> 
>
> I excluded hbase and hadoop dependency from my project and added
> shadedcdh as dependency. But this is still giving me the same
> exception. The dependency tree I have posted in the stackoverflow. I
> could not post here because of size limitation. Can someone let me
> know how can I avoid the conflict?
>


Avoid guava version conflict with hbase by shading

2018-01-19 Thread Debraj Manna
I have posted more details in stackoverflow
.
I could not add all the details here because of size limitation.

In a project I am using Guava 23.5 but some of the dependencies (hadoop &
hbase) are using old Guava 14. This is causing an exception during runtime

As mentioned here  I
tried to shade the Hbase dependency in a new module named shadedcdh. pom.xml
looks like below

?xml version="1.0" encoding="UTF-8"?>

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;>

main
com.vnera
0.001-SNAPSHOT

4.0.0

shaded-cdh
jar



org.apache.hbase
hbase-testing-util
1.2.0-cdh5.7.0


org.apache.hadoop
hadoop-client
${hadoop.version}


org.apache.hadoop
hadoop-common
${hadoop.version}


org.apache.hbase
hbase-client

1.2.0-cdh5.7.0






org.apache.maven.plugins
maven-shade-plugin
2.4.1


package

shade




com.google.common

shaded.com.google.common














cloudera

https://repository.cloudera.com/artifactory/cloudera-repos/




I excluded hbase and hadoop dependency from my project and added
shadedcdh as dependency. But this is still giving me the same
exception. The dependency tree I have posted in the stackoverflow. I
could not post here because of size limitation. Can someone let me
know how can I avoid the conflict?


Re: How does mvn dependency:analyze work?

2018-01-18 Thread Debraj Manna
Thanks Filipe . Any thoughts about my second query


   - Does Unused declared dependencies found check only for the direct
   dependencies declared in pom.xml or it checks transitive dependencies as
   well?


On Thu, Jan 18, 2018 at 3:34 PM, Filipe Sousa <nat...@gmail.com> wrote:

> From
> http://books.sonatype.com/mvnex-book/reference/optimizing-sect-dependency-
> plugin.html <http://books.sonatype.com/mvnex-book/reference/
> optimizing-sect-dependency-plugin.html>
>
> "A good rule of thumb in Maven is to always declare explicit dependencies
> for classes referenced in your code.”
>
> From time to time I run dependency:analyze -DignoreNonCompile=true
> -DoutputXML=true
>
> > On 18 Jan 2018, at 07:31, Debraj Manna <subharaj.ma...@gmail.com> wrote:
> >
> > Cross-posting from stackoverflow
> > <https://stackoverflow.com/questions/48315863/how-does-
> mvn-dependencyanalyze-work>
> >
> > Can someone let me know how does mvn dependency:analyze work ? An output
> of mvn
> > dependency:analyze in one of my project shows
> >
> > [WARNING] Used undeclared dependencies found:[WARNING]
> > org.apache.commons:commons-lang3:jar:3.4:compile[WARNING]
> > com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:
> compile...[WARNING]
> > Unused declared dependencies found:[WARNING]
> > org.springframework.boot:spring-boot-starter-test:jar:
> 1.5.4.RELEASE:test[WARNING]
> >   org.springframework.restdocs:spring-restdocs-mockmvc:jar:1.
> 1.3.RELEASE:test[WARNING]
> >   ch.qos.logback:logback-classic:jar:1.1.11:compile
> >
> > Can some one let me know the following -
> >
> >   - What does Used undeclared dependencies found denote? Does it mean
> that
> >   this is not declared in pom.xml dependencies but getting used in code
> >   and is included via some transitive dependencies?
> >   - Does Unused declared dependencies found check only for the
> > dependencies declared
> >   in pom.xml or it checks transitive dependencies as well?
> >
> > Maven Version - 3.5.0
>
>


How does mvn dependency:analyze work?

2018-01-17 Thread Debraj Manna
Cross-posting from stackoverflow


Can someone let me know how does mvn dependency:analyze work ? An output of mvn
dependency:analyze in one of my project shows

[WARNING] Used undeclared dependencies found:[WARNING]
org.apache.commons:commons-lang3:jar:3.4:compile[WARNING]
com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile...[WARNING]
Unused declared dependencies found:[WARNING]
org.springframework.boot:spring-boot-starter-test:jar:1.5.4.RELEASE:test[WARNING]
   
org.springframework.restdocs:spring-restdocs-mockmvc:jar:1.1.3.RELEASE:test[WARNING]
   ch.qos.logback:logback-classic:jar:1.1.11:compile

Can some one let me know the following -

   - What does Used undeclared dependencies found denote? Does it mean that
   this is not declared in pom.xml dependencies but getting used in code
   and is included via some transitive dependencies?
   - Does Unused declared dependencies found check only for the
dependencies declared
   in pom.xml or it checks transitive dependencies as well?

Maven Version - 3.5.0


On upgrading Guava to the latest 23.5 getting NoSuchMethodError for Preconditions.checkArgument

2017-12-21 Thread Debraj Manna
HI

Cross-posting from stackoverflow

if
anyone can help me here

On upgrading Guava to the latest 23.5-jre from 18.0 I am getting an
exception like below

Exception in thread "main" java.lang.NoSuchMethodError:
com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
at com.van.common.VanExecutors.getSpec(VanExecutors.java:91)
at
com.van.common.VanExecutors.newFixedSizeExecutor(VanExecutors.java:114)
at
com.van.storage.config.ConfigStoreFactory.getOrCreateUncachedStore(ConfigStoreFactory.java:56)
at
com.van.storage.config.ConfigStoreFactory.getOrCreateStore(ConfigStoreFactory.java:74)
at
com.van.storage.config.PolicyManager.loadFromSystemProperties(PolicyManager.java:79)
at
com.van.tools.metric.HbaseMetricStoreSetup.main(HbaseMetricStoreSetup.java:25)
The relevant code

private ExecutorSpec getSpec(String executorName) {
Preconditions.checkArgument(isValid(), "Not initialized");
Preconditions.checkArgument(NullOrEmpty.isFalse(executorName), "No
executor name given");

Preconditions.checkArgument(POOL_NAME_PATTERN.matcher(executorName).matches(),
"Executor name %s must end with -exec", executorName);
for (ExecutorSpec spec : executorsSpec.getExecutorSpecList()) {
if (spec.getName().equalsIgnoreCase(executorName)) return spec;
}
return null;
}
As per the stacktrace line 91 is the last Preconditions check.

Can someone let me know what is going wrong?

As per the discussion in stackoverflow it seems during compilation it is
using the latest version but while running it is picking the old version
from classpath.

I have verified in mvn dependency:tree that there is no reference to the
older version. I have also deleted by .m2 directory but while compiling I
am seeing it is still downloading the older versions of guava.

Can someone let me know how can I get around this ?

Thanks,


Execution time of tests in unit test class via maven surefire-report in a single file in summarized format

2017-08-24 Thread Debraj Manna
Just cross posting from stackoverflow


Can anyone let me know how can I get the time taken by each of the unit
tests in a unit test class in a single file via maven-surefire? I have seen
my target/surefire-report it has files for each test. Basically I am
looking for a single file with all the execution times summarized. If
possible also sort the result by execution time of each test.

I am using maven 3.5 & surefire-plugin 2.4.2.


Re: surefire-report behavior in multi-module project with DnoTest=true

2017-07-02 Thread Debraj Manna
Hi

Any thoughts on this?

On Fri, Jun 23, 2017 at 2:40 PM, Debraj Manna <subharaj.ma...@gmail.com>
wrote:

> Hi
>
> Crossposting from stackoverflow
> <https://stackoverflow.com/questions/44717069/surefire-report-behavior-in-multi-module-project-with-dnotest-true>
> :-
>
> I have a multimodule maven project
>
> 
> A
> B
> C
> D
>
> B depends on A and C depends on B. I do not want to execute unit tests on
> A & D.
>
> So I have added skipTest like below in module A:-
>
> 
> org.apache.maven.plugins
> maven-surefire-plugin
> ${mvn.surefire.plugin.version}
> 
> true
> 
>
> If I execute the below two maven commands:-
>
> mvn clean package -DskipTests -T 6
> mvn surefire-report:report -DnoTest=true
>
> Will D be compiled and build again in surefire-report phase or just A, B
>  & C be compiled and their test will be executed?
>
> If yes then is there a way I can prevent the compiling of D in surefire
> phase as I don't want to execute tests on D?
>
> I am using maven 3.2.x.
>
> Thanks,
>
> Debraj
>


surefire-report behavior in multi-module project with DnoTest=true

2017-06-23 Thread Debraj Manna
Hi

Crossposting from stackoverflow

:-

I have a multimodule maven project


A
B
C
D

B depends on A and C depends on B. I do not want to execute unit tests on A
 & D.

So I have added skipTest like below in module A:-


org.apache.maven.plugins
maven-surefire-plugin
${mvn.surefire.plugin.version}

true


If I execute the below two maven commands:-

mvn clean package -DskipTests -T 6
mvn surefire-report:report -DnoTest=true

Will D be compiled and build again in surefire-report phase or just A, B & C be
compiled and their test will be executed?

If yes then is there a way I can prevent the compiling of D in surefire
phase as I don't want to execute tests on D?

I am using maven 3.2.x.

Thanks,

Debraj


MNG-4706 - aether.connector.basic.threads & aether.connector.resumeDownloads

2017-06-18 Thread Debraj Manna
HI

Can someone point me to the documentation what does the below two options
mean as mentioned in the comment of MNG-4706


-Daether.connector.basic.threads=1
-Daether.connector.resumeDownloads=false


Re: Maven antrun failing in parallel builds but working fine in non-parallel builds

2017-06-14 Thread Debraj Manna
Thanks MG for replying.

Can you please explain  a bit how does adding classpaths to ant will
resolve the failure in case of parallel builds?

On 14-Jun-2017 6:38 pm, "Martin Gainty" <mgai...@hotmail.com> wrote:

MG>see below


____
From: Debraj Manna <subharaj.ma...@gmail.com>
Sent: Tuesday, June 13, 2017 8:34 AM
To: Maven Users List
Subject: Maven antrun failing in parallel builds but working fine in
non-parallel builds

I am having a maven multi module project. A simplified pom.xml (under
full-build) looks like below:-

http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd;
 xmlns="http://maven.apache.org/POM/4.0.0;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
4.0.0
pom
com.eros
full-build
0.001-SNAPSHOT
full-build


build-only

true


../../main



copy-only

true




maven-antrun-plugin
1.8


package

MG>add (maven.compile,maven.runtime,maven.test,maven.plugin) classpaths to
ant (compile,runtime,test,plugin) classpaths e.g.

 
   














 


run









The simplified pom.xml inside main looks like below:-

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

com.eros
main
0.001-SNAPSHOT
pom
main

collector-framework




org.apache.maven.plugins
maven-enforcer-plugin
1.4


enforce-versions

enforce




[1.8,)
*** This project requires
JDK 1.8/J2SE 8 or later. ***







org.apache.maven.plugins
maven-compiler-plugin
3.1

1.8
1.8





Whenever I try to execute the above project with mvn clean install -T 4 the
collector-framework project gets skipped and the build fails with error

Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default) on
project full-build: An Ant BuildException has occured: Warning: Could
not find file /Users/tuk/code/github/eros/main/collector-framework/
collector/target/collector-0.001-SNAPSHOT.jar
to copy.
[ERROR] around Ant part .. @ 4:143
in /Users/tuk/code/github/eros/main/full-build/target/antrun/build-main.xml

Everything works fine if I just do mvn clean install. I think this is
happening because ant-run is running before the main module execution is
finished. Can someone let me know how can I make ant-run wait till main
module compilation is over in case of parallel builds?

   - Maven Version - 3.5.0


Maven antrun failing in parallel builds but working fine in non-parallel builds

2017-06-13 Thread Debraj Manna
I am having a maven multi module project. A simplified pom.xml (under
full-build) looks like below:-

http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd;
 xmlns="http://maven.apache.org/POM/4.0.0;
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
4.0.0
pom
com.eros
full-build
0.001-SNAPSHOT
full-build


build-only

true


../../main



copy-only

true




maven-antrun-plugin
1.8


package







run









The simplified pom.xml inside main looks like below:-

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

com.eros
main
0.001-SNAPSHOT
pom
main

collector-framework




org.apache.maven.plugins
maven-enforcer-plugin
1.4


enforce-versions

enforce




[1.8,)
*** This project requires
JDK 1.8/J2SE 8 or later. ***







org.apache.maven.plugins
maven-compiler-plugin
3.1

1.8
1.8





Whenever I try to execute the above project with mvn clean install -T 4 the
collector-framework project gets skipped and the build fails with error

Failed to execute goal
org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default) on
project full-build: An Ant BuildException has occured: Warning: Could
not find file 
/Users/tuk/code/github/eros/main/collector-framework/collector/target/collector-0.001-SNAPSHOT.jar
to copy.
[ERROR] around Ant part .. @ 4:143
in /Users/tuk/code/github/eros/main/full-build/target/antrun/build-main.xml

Everything works fine if I just do mvn clean install. I think this is
happening because ant-run is running before the main module execution is
finished. Can someone let me know how can I make ant-run wait till main
module compilation is over in case of parallel builds?

   - Maven Version - 3.5.0


maven-jaxb2-plugin: Error in parsing schema location even when xsd and xjb files are in same location

2017-06-12 Thread Debraj Manna
I am having a pom.xml which looks like below:-

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


com.eros
model
0.001-SNAPSHOT


nato-model
jar
nato-model



com.eros
core-model
${main.version}






org.jvnet.jaxb2.maven2
maven-jaxb2-plugin
0.13.1

false
false
true





b

generate



com.eros.model.nato.n5k

${project.build.directory}/generated-sources/jaxb


${project.basedir}/../../schema/src/main/xsd/com/eros/model/nato/custom_xsds


n5k.xsd


${project.basedir}/../../schema/src/main/xsd/com/eros/model/nato/custom_xsds

n5k.xjb

false
true



n7k

generate



com.eros.model.nato.n7k

${project.build.directory}/generated-sources/jaxb


${project.basedir}/../../schema/src/main/xsd/com/eros/model/nato/custom_xsds


n7k.xsd


${project.basedir}/../../schema/src/main/xsd/com/eros/model/nato/custom_xsds
false
true









My n5k.xjb file looks like below:-

http://java.sun.com/xml/ns/jaxb;
schemaLocation="./n5k.xsd">




My n7k.xjb looks like below:-

http://java.sun.com/xml/ns/jaxb; schemaLocation="n7k.xsd">




But on compiling I am getting the below error:-

Error while parsing schema(s).Location [
file:/Users/tuk/code/github/eros/main/schema/src/main/xsd/com/eros/model/nato/custom_xsds/n5k.xjb{2,102}].
com.sun.istack.SAXParseException2; systemId:
file:/Users/tuk/code/github/eros/main/schema/src/main/xsd/com/eros/model/nato/custom_xsds/n5k.xjb;
lineNumber: 2; columnNumber: 102;
"file:/Users/tuk/code/github/eros/main/schema/src/main/xsd/com/eros/model/nato/custom_xsds/n5k.xsd"
is not a part of this compilation. Is this a mistake for
"file:/Users/tuk/code/github/eros/main/schema/src/main/xsd/com/eros/model/nato/custom_xsds/n7k.xsd"

Can someone let me know what I am doing wrong?

Environment:-

   - Java 8
   - Maven 3.5


Avoid Unnecessary regeneration in jaxb2-maven-plugin

2017-06-12 Thread Debraj Manna
Hi

Is it possible to avoid unnecessary regeneration in jaxb2-maven-plugin?
Basically I want to generate the sources only when underlying schema has
changed?

 It seems maven-jaxb2-plugin has an option force-regenerate
.
Do similar option exist in jaxb2-maven-plugin? If not can someone suggest
me some way to achieve this?


Re: Profiling Maven Compilation for a multi-module project

2017-06-09 Thread Debraj Manna
Hi

Using https://github.com/jcgay/maven-profiler I am able to get the
execution time of each step.

I am talking about the execution time of mvn clean install.

Since I am building with multiple threads option (-T 4). Is there a way I
can view which plugin execution are executing in which thread. Basically I
want to know which plugin execution is happening in parallel to which
execution.

Thanks,
tuk

On Fri, Jun 9, 2017 at 11:18 PM, Karl Heinz Marbaise <khmarba...@gmx.de>
wrote:

> Hi,
>
> first I would suggest to check with:
>
> https://github.com/khmarbaise/maven-buildtime-profiler
>
>
> On 09/06/17 15:02, Debraj Manna wrote:
>
>> Just cross-posting this from stack overflow
>> <https://stackoverflow.com/questions/44458414/profiling-mave
>> n-compilation-for-a-multi-module-project>
>> :-
>>
>> I have a multi module maven project which is taking a little too much
>> time.
>>
>
> What does "too much time" mean? About which time are we talking about...
>
>
> Can some one let me know if there is a way it is possible for me to see
>> which step in maven is taking how much time. Also is it possible to see
>> which steps are getting executed in parallel relative to which step?
>>
>
> Maybe I misunderstand your question but what about comparing:
>
> mvn clean package
> against:
> mvn -T clean package
>
> ?
> Kind regards
> Karl Heinz Marbaise
>
>>
>> I am executing maven with -T 4.
>>
>>
>> - Maven Version 3.5.0
>>
>> Thanks,
>> tuk
>>
>>
>


Profiling Maven Compilation for a multi-module project

2017-06-09 Thread Debraj Manna
Just cross-posting this from stack overflow

:-

I have a multi module maven project which is taking a little too much time.
Can some one let me know if there is a way it is possible for me to see
which step in maven is taking how much time. Also is it possible to see
which steps are getting executed in parallel relative to which step?

I am executing maven with -T 4.


   - Maven Version 3.5.0

Thanks,
tuk


Order of maven repositories in settings.xml

2016-10-23 Thread Debraj Manna
I have a settings.xml which looks like below:-

http://maven.apache.org/SETTINGS/1.0.0; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="
http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd;>
   
  
 nexusReleases
 jabong
 jabong123
  
  
 nexusSnapshots
 jabong
 jabong123
  
   



space

   
central
http://repo1.maven.org/maven2


nReleases
Releases
http://someserver/repository/maven-releases/

   
nSnapshots
Snapshots
http://someserver/repository/maven-snapshots/
   





space



I want maven to check repo1.maven.org first and then only look in someserver.
Can some one let me know how this can be achieved?

I am using maven 3.3.9.


How does maven internally manages package dependency?

2016-06-15 Thread Debraj Manna
Can some let me know how does maven internally manages package dependency?
Is there any architecture diagram available on the net for the same? I also
asked this in Quora
 but
did not get any response their nor I am able to find any suitable resources
in the web that explains the working of maven and even better if I can find
some class diagram?