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 <sirisha.a...@oracle.com> 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 <ol...@apache.org>
> Sent: Tuesday, April 18, 2023 11:29 AM
> To: Maven Users List <users@maven.apache.org>
> Subject: Re: [External] : Re: NPE Exception with Surefire3.0.0
>
> Hi
> Do you really need the dependencies section within the plugin section?
> just use
>   <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-surefire-plugin</artifactId>
>                 <version>3.0.0</version>
>               </plugin>
>             </plugins>
> ....
>
>
> On Tue, 18 Apr 2023 at 15:56, Sirisha Alla <sirisha.a...@oracle.com>
> 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.
> >
> >         <dependency>
> >                 <groupId>org.mockito</groupId>
> >                 <artifactId>mockito-core</artifactId>
> >                 <version>4.11.0</version>
> >          <scope>test</scope>
> >         </dependency>
> >         <dependency>
> >         <groupId>org.junit.jupiter</groupId>
> >         <artifactId>junit-jupiter-api</artifactId>
> >         <version>5.9.2</version>
> >         <scope>test</scope>
> >         </dependency>
> >   </dependencies>
> >
> >   <build>
> >         <plugins>
> >             <plugin>
> >                 <groupId>org.apache.maven.plugins</groupId>
> >                 <artifactId>maven-surefire-plugin</artifactId>
> >                 <version>3.0.0</version>
> >                 <dependencies>
> >                 <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>maven-surefire-common</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>surefire-booter</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >         <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>surefire-logger-api</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>surefire-api</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>surefire-extensions-api</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.codehaus.plexus</groupId>
> >                         <artifactId>plexus-java</artifactId>
> >                         <version>1.1.2</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>surefire-shared-utils</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.maven.shared</groupId>
> >
>  <artifactId>maven-common-artifact-filters</artifactId>
> >                         <version>3.3.2</version>
> >                 </dependency>
> >         <dependency>
> >                         <groupId>org.eclipse.aether</groupId>
> >                         <artifactId>aether-util</artifactId>
> >                         <version>1.1.0</version>
> >                 </dependency>
> >                 <dependency>
> >                         <groupId>org.apache.maven.surefire</groupId>
> >                         <artifactId>surefire-junit-platform</artifactId>
> >                         <version>3.0.0</version>
> >                 </dependency>
> >         <dependency>
> >                 <groupId>org.junit.jupiter</groupId>
> >                 <artifactId>junit-jupiter-engine</artifactId>
> >                 <version>5.9.2</version>
> >                 <scope>runtime</scope>
> >         </dependency>
> >         <dependency>
> >                 <groupId>org.junit.platform</groupId>
> >                 <artifactId>junit-platform-engine</artifactId>
> >                 <version>1.9.2</version>
> >                 <scope>runtime</scope>
> >         </dependency>
> >
> >                 </dependencies>
> >             </plugin>
> >         </plugins>
> >   </build>
> >
> > Thanks,
> > Sirisha
> >
> > -----Original Message-----
> > From: Benjamin Marwell <bmarw...@apache.org>
> > Sent: Tuesday, April 18, 2023 11:16 AM
> > To: Maven Users List <users@maven.apache.org>
> > 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, <sirisha.a...@oracle.com>
> 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
> > > org.apache.maven.plugin.surefire.AbstractSurefireMojo.createForkStar
> > > te
> > > r
> > > (AbstractSurefireMojo.java:2165)
> > >     at
> > > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvide
> > > r
> > > (AbstractSurefireMojo.java:1192)
> > >     at
> > > org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPr
> > > ec
> > > 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.buildProj
> > > ec
> > > t
> > > (LifecycleModuleBuilder.java:117)
> > >     at
> > > org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThrea
> > > de
> > > dBuilder$1.call
> > > (MultiThreadedBuilder.java:210)
> > >     at
> > > org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThrea
> > > de
> > > dBuilder$1.call
> > > (MultiThreadedBuilder.java:195)
> > >     at java.util.concurrent.FutureTask.run (FutureTask.java:266)
> > >     at java.util.concurrent.Executors$RunnableAdapter.call
> > > (Executors.java:511)
> > >     at java.util.concurrent.FutureTask.run (FutureTask.java:266)
> > >     at java.util.concurrent.ThreadPoolExecutor.runWorker
> > > (ThreadPoolExecutor.java:1149)
> > >     at java.util.concurrent.ThreadPoolExecutor$Worker.run
> > > (ThreadPoolExecutor.java:624)
> > >     at java.lang.Thread.run (Thread.java:748)
> > >
> > > Thanks,
> > > Sirisha
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>

Reply via email to