Re: [External] : Re: NPE Exception with Surefire3.0.0

2023-04-18 Thread Greg Chabala
While this may have been a rookie mistake and this pom is nonsensical, they
did manage to cause an NPE in a standard plugin.

That's a bug worth tracking down, right? Better validation, better error
messages?


Re: [External] : Re: NPE Exception with Surefire3.0.0

2023-04-18 Thread Francois Marot
You should get rif of all the dependencies and then test if your problem
has disappeared.
If yes, all good, and next time let Maven handle transitive dependencies
for you.
If no, then you have a real problem that maybe some people here will be
able to help you with.

But overriding all the dependencies is just plain impossible to maintain:
imagine the sligest incompatibility between 2 dependency might lead to
errors if you a version instead of another !
And in case of upgrading a plugin, what a huge amount of work to update all
its dependencies ! Unmanageable...

good luck



Le mar. 18 avr. 2023 à 06:13, Sirisha Alla  a
écrit :

> I am a newbee to Maven and I want to override any dependencies (along with
> versions) from parent pom.xml. Not sure if this is the right way.
>
> Thanks,
> Sirisha
>
> -Original Message-
> From: Olivier Lamy 
> Sent: Tuesday, April 18, 2023 11:29 AM
> To: Maven Users List 
> Subject: Re: [External] : Re: NPE Exception with Surefire3.0.0
>
> Hi
> Do you really need the dependencies section within the plugin section?
> just use
>   
> 
> 
> org.apache.maven.plugins
> maven-surefire-plugin
> 3.0.0
>   
> 
> 
>
>
> On Tue, 18 Apr 2023 at 15:56, Sirisha Alla 
> wrote:
> >
> > I am using the maven version 3.8.7. pom.xml has other internal module
> dependencies and below is the snippet from pom.xml for the junit tests
> added.
> >
> > 
> > org.mockito
> > mockito-core
> > 4.11.0
> >  test
> > 
> > 
> > org.junit.jupiter
> > junit-jupiter-api
> > 5.9.2
> > test
> > 
> >   
> >
> >   
> > 
> > 
> > org.apache.maven.plugins
> > maven-surefire-plugin
> > 3.0.0
> > 
> > 
> > org.apache.maven.surefire
> > maven-surefire-common
> > 3.0.0
> > 
> > 
> > org.apache.maven.surefire
> > surefire-booter
> > 3.0.0
> > 
> > 
> > org.apache.maven.surefire
> > surefire-logger-api
> > 3.0.0
> > 
> > 
> > org.apache.maven.surefire
> > surefire-api
> > 3.0.0
> > 
> > 
> > org.apache.maven.surefire
> > surefire-extensions-api
> > 3.0.0
> > 
> > 
> > org.codehaus.plexus
> > plexus-java
> > 1.1.2
> > 
> > 
> > org.apache.maven.surefire
> > surefire-shared-utils
> > 3.0.0
> > 
> > 
> > org.apache.maven.shared
> >
>  maven-common-artifact-filters
> > 3.3.2
> > 
> > 
> > org.eclipse.aether
> > aether-util
> > 1.1.0
> > 
> > 
> > org.apache.maven.surefire
> > surefire-junit-platform
> > 3.0.0
> > 
> > 
> >             org.junit.jupiter
> > junit-jupiter-engine
> > 5.9.2
> > runtime
> > 
> > 
> > org.junit.platform
> > junit-platform-engine
> > 1.9.2
> > runtime
> > 
> >
> > 
> > 
> > 
> >   
> >
> > Thanks,
> > Sirisha
> >
> > -Original Message-
> > From: Benjamin Marwell 
> > Sent: Tuesday, April 18, 2023 11:16 AM
> > To: Maven Users List 
> > Subject: [External] : Re: NPE Exception w

RE: [External] : Re: NPE Exception with Surefire3.0.0

2023-04-18 Thread Sirisha Alla
I am a newbee to Maven and I want to override any dependencies (along with 
versions) from parent pom.xml. Not sure if this is the right way.

Thanks,
Sirisha

-Original Message-
From: Olivier Lamy  
Sent: Tuesday, April 18, 2023 11:29 AM
To: Maven Users List 
Subject: Re: [External] : Re: NPE Exception with Surefire3.0.0

Hi
Do you really need the dependencies section within the plugin section?
just use
  


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




On Tue, 18 Apr 2023 at 15:56, Sirisha Alla  wrote:
>
> I am using the maven version 3.8.7. pom.xml has other internal module 
> dependencies and below is the snippet from pom.xml for the junit tests added.
>
> 
> org.mockito
> mockito-core
> 4.11.0
>  test
> 
> 
> org.junit.jupiter
> junit-jupiter-api
> 5.9.2
> test
> 
>   
>
>   
> 
> 
> org.apache.maven.plugins
> maven-surefire-plugin
> 3.0.0
> 
> 
> org.apache.maven.surefire
> maven-surefire-common
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-booter
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-logger-api
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-api
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-extensions-api
> 3.0.0
> 
> 
> org.codehaus.plexus
> plexus-java
> 1.1.2
> 
> 
> org.apache.maven.surefire
> surefire-shared-utils
> 3.0.0
> 
> 
> org.apache.maven.shared
> maven-common-artifact-filters
> 3.3.2
> 
> 
> org.eclipse.aether
> aether-util
> 1.1.0
> 
> 
> org.apache.maven.surefire
> surefire-junit-platform
> 3.0.0
> 
> 
> org.junit.jupiter
> junit-jupiter-engine
> 5.9.2
> runtime
> 
> 
> org.junit.platform
> junit-platform-engine
> 1.9.2
>         runtime
> 
>
> 
> 
> 
>   
>
> Thanks,
> Sirisha
>
> -Original Message-
> From: Benjamin Marwell 
> Sent: Tuesday, April 18, 2023 11:16 AM
> To: Maven Users List 
> Subject: [External] : Re: NPE Exception with Surefire3.0.0
>
> Which version of Maven are you using?
> Can you give us a relevant snippet of your pom.xml to reproduce the issue?
>
>
>
> On Mon, 17 Apr 2023, 17:07 Sirisha Alla,  wrote:
>
> > Hi All,
> >
> > I am using surefire 3.0.0 with Junit 5 (Jupiter-engine). However, I 
> > am stumbling in to the Null Pointer Exception and could not trace the issue.
> > Has anyone faced this issue or any pointers that can help me proceed?
> > I am using JDK1.8.
> >
> > Caused by: java.lang.NullPointerException
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.hasGroupArtifa
> > ct
> > Id
> > (AbstractSurefireMojo.java:1771)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.retainInProcAr
> > ti
> > factsUnique
> > (AbstractSurefireMojo.java:1757)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.newStartupConf
> > ig
> > WithClasspath
> > (AbstractSurefireMojo.java:1735)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.createStartupC
> > on
> > figuration
> > (AbstractSurefireMojo.java:1701)
> > at
> 

Re: [External] : Re: NPE Exception with Surefire3.0.0

2023-04-17 Thread Olivier Lamy
Hi
Do you really need the dependencies section within the plugin section?
just use
  


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




On Tue, 18 Apr 2023 at 15:56, Sirisha Alla  wrote:
>
> I am using the maven version 3.8.7. pom.xml has other internal module 
> dependencies and below is the snippet from pom.xml for the junit tests added.
>
> 
> org.mockito
> mockito-core
> 4.11.0
>  test
> 
> 
> org.junit.jupiter
> junit-jupiter-api
> 5.9.2
> test
> 
>   
>
>   
> 
> 
> org.apache.maven.plugins
> maven-surefire-plugin
> 3.0.0
> 
> 
> org.apache.maven.surefire
> maven-surefire-common
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-booter
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-logger-api
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-api
> 3.0.0
> 
> 
> org.apache.maven.surefire
> surefire-extensions-api
> 3.0.0
> 
> 
> org.codehaus.plexus
> plexus-java
> 1.1.2
> 
> 
> org.apache.maven.surefire
> surefire-shared-utils
> 3.0.0
> 
> 
> org.apache.maven.shared
> maven-common-artifact-filters
> 3.3.2
> 
> 
> org.eclipse.aether
> aether-util
> 1.1.0
> 
> 
> org.apache.maven.surefire
> surefire-junit-platform
> 3.0.0
> 
> 
> org.junit.jupiter
> junit-jupiter-engine
> 5.9.2
> runtime
> 
> 
> org.junit.platform
> junit-platform-engine
> 1.9.2
>         runtime
> 
>
> 
> 
> 
>   
>
> Thanks,
> Sirisha
>
> -Original Message-
> From: Benjamin Marwell 
> Sent: Tuesday, April 18, 2023 11:16 AM
> To: Maven Users List 
> Subject: [External] : Re: NPE Exception with Surefire3.0.0
>
> Which version of Maven are you using?
> Can you give us a relevant snippet of your pom.xml to reproduce the issue?
>
>
>
> On Mon, 17 Apr 2023, 17:07 Sirisha Alla,  wrote:
>
> > Hi All,
> >
> > I am using surefire 3.0.0 with Junit 5 (Jupiter-engine). However, I am
> > stumbling in to the Null Pointer Exception and could not trace the issue.
> > Has anyone faced this issue or any pointers that can help me proceed?
> > I am using JDK1.8.
> >
> > Caused by: java.lang.NullPointerException
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.hasGroupArtifact
> > Id
> > (AbstractSurefireMojo.java:1771)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.retainInProcArti
> > factsUnique
> > (AbstractSurefireMojo.java:1757)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.newStartupConfig
> > WithClasspath
> > (AbstractSurefireMojo.java:1735)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.createStartupCon
> > figuration
> > (AbstractSurefireMojo.java:1701)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.createForkStarte
> > r
> > (AbstractSurefireMojo.java:2165)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider
> > (AbstractSurefireMojo.java:1192)
> > at
> > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPrec
> > onditionsChecked
> > (AbstractS

RE: [External] : Re: NPE Exception with Surefire3.0.0

2023-04-17 Thread Sirisha Alla
I am using the maven version 3.8.7. pom.xml has other internal module 
dependencies and below is the snippet from pom.xml for the junit tests added.


org.mockito
mockito-core
4.11.0
 test


org.junit.jupiter
junit-jupiter-api
5.9.2
test

  

  


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


org.apache.maven.surefire
maven-surefire-common
3.0.0


org.apache.maven.surefire
surefire-booter
3.0.0


org.apache.maven.surefire
surefire-logger-api
3.0.0


org.apache.maven.surefire
surefire-api
3.0.0


org.apache.maven.surefire
surefire-extensions-api
3.0.0


org.codehaus.plexus
plexus-java
1.1.2


org.apache.maven.surefire
surefire-shared-utils
3.0.0


org.apache.maven.shared
maven-common-artifact-filters
3.3.2


org.eclipse.aether
aether-util
1.1.0


org.apache.maven.surefire
surefire-junit-platform
3.0.0


org.junit.jupiter
junit-jupiter-engine
5.9.2
runtime


org.junit.platform
junit-platform-engine
1.9.2
runtime





  

Thanks,
Sirisha

-Original Message-
From: Benjamin Marwell  
Sent: Tuesday, April 18, 2023 11:16 AM
To: Maven Users List 
Subject: [External] : Re: NPE Exception with Surefire3.0.0

Which version of Maven are you using?
Can you give us a relevant snippet of your pom.xml to reproduce the issue?



On Mon, 17 Apr 2023, 17:07 Sirisha Alla,  wrote:

> Hi All,
>
> I am using surefire 3.0.0 with Junit 5 (Jupiter-engine). However, I am 
> stumbling in to the Null Pointer Exception and could not trace the issue.
> Has anyone faced this issue or any pointers that can help me proceed? 
> I am using JDK1.8.
>
> Caused by: java.lang.NullPointerException
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.hasGroupArtifact
> Id
> (AbstractSurefireMojo.java:1771)
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.retainInProcArti
> factsUnique
> (AbstractSurefireMojo.java:1757)
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.newStartupConfig
> WithClasspath
> (AbstractSurefireMojo.java:1735)
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.createStartupCon
> figuration
> (AbstractSurefireMojo.java:1701)
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.createForkStarte
> r
> (AbstractSurefireMojo.java:2165)
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider
> (AbstractSurefireMojo.java:1192)
> at
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPrec
> onditionsChecked
> (AbstractSurefireMojo.java:1055)
> at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute
> (AbstractSurefireMojo.java:871)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> (DefaultBuildPluginManager.java:137)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2
> (MojoExecutor.java:370)
> at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute
> (MojoExecutor.java:351)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:215)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:171)
> at org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:163)
> at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
> t
> (LifecycleModuleBuilder.java:117)
> at
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreade
> dBuilder$1.cal