Oh right, I thought he was going to fix something in surefire
There's also https://maven.apache.org/guides/mini/guide-attached-tests.html

-       <plugin>
-           <groupId>org.apache.maven.plugins</groupId>
-           <artifactId>maven-surefire-plugin</artifactId>
-           <version>${surefire.version}</version> <!-- remember to
set version as needed -->
-           <configuration>
-               <dependenciesToScan>
-
<dependency>com.myco.app:foo-core:test-jar:tests</dependency>
-               </dependenciesToScan>
-           </configuration>

Delany

On Thu, 16 Feb 2023 at 12:53, Olivier Lamy <ol...@apache.org> wrote:

> On Thu, 16 Feb 2023 at 20:07, Delany <delany.middle...@gmail.com> wrote:
> >
> > Hi Stephane,
> >
> > You can do like this
> >
> >         <plugin>
> >           <artifactId>maven-surefire-plugin</artifactId>
> >           <version>3.0.0-M9</version>
> >           <dependencies>
> >             <dependency>
> >               <groupId>org.apache.commons</groupId>
> >               <artifactId>commons-email</artifactId>
> >               <version>1.5</version>
> >             </dependency>
> >           </dependencies>
> >         </plugin>
>
> this will add dependencies to the surefire plugin itself.
> I guess Stephane wants to add to the jvm running the tests?
>
> additionalClasspathElement expect a full path to a directory or a file
> to be added to the classpath
>
> should work with something such but you need to assume commons-email
> has been resolved locally as a dependency.
>
> <additionalClasspathElement>${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar</additionalClasspathElement>
>
> another solution is to use dependency:copy to copy the commons-email
> dependency somewhere in ./target and use this path (see
>
> https://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html
> )
>
> hth
> Olivier
>
> >
> > On Thu, 16 Feb 2023 at 11:25, Stephane Passignat <passig...@hotmail.com>
> > wrote:
> >
> > > Hello,
> > >
> > > Is it possible to add a maven artifact as an
> additionalClasspathElement ?
> > >
> > > I tried this syntax, inspired by the exclusion mechanism, but it's not
> > > working.
> > >
> > > <build>
> > >     <plugins>
> > >        <plugin>
> > >           <groupId>org.apache.maven.plugins</groupId>
> > >           <artifactId>maven-surefire-plugin</artifactId>
> > >           <version>3.0.0-M9</version>
> > >           <configuration>
> > >              <additionalClasspathElements>
> > >
> > >
> <additionalClasspathElement>org.apache.commons:commons-email:1.5</additionalClasspathElement>
> > >              </additionalClasspathElements>
> > >           </configuration>
> > >        </plugin>
> > >     </plugins>
> > > </build>
> > >
> > >
> > > thank you
> > >
> > > Stéphane
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to