Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-23 Thread Stephane Passignat

thanks,

I gave a second try to extensions and it seems works now.


stephane



Le 2023-02-23 à 09:52, Alexander Kriegisch a écrit :

Would you not rather write a Maven plugin or extension for something
like that and hook it into the build process globally, so you can use it
when specifying `repository` or `pluginReporitory` entries in the POM
needing it? This does not seem to be something limited to certain
plugins, if I understand correctly.

Alexander Kriegisch
https://scrum-master.de


Stephane Passignat schrieb am 22.02.2023 um 11:27:

Hello,

thank you everyone for these suggestions. Let's go back to my original
issue.

I need to add a library to maven classpath. The library I need is
another RepositoryLayoutFactory, to download artifact located is a
repository which is not yet supported by Maven. Actually it's a basic
HTTP server. (It could be an FTP server or a database accessed is JDBC...)

The library is made, it works (as well as I need), but to use it I need
to add it to maven/lib/ext which is not portable to other computer. So
I'm looking at alternatives. Surefire could be a candidate, or not...


I hope this helps to understand.

regards,


Stephane


Le 2023-02-16 à 11:58, Olivier Lamy a écrit :

On Thu, 16 Feb 2023 at 20:52, Olivier Lamy   wrote:

On Thu, 16 Feb 2023 at 20:07, Delany   wrote:

Hi Stephane,

You can do like this

  
maven-surefire-plugin
3.0.0-M9

  
org.apache.commons
commons-email
1.5
  

  

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.
${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar

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)


a real example here :)
https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml


hth
Olivier


On Thu, 16 Feb 2023 at 11:25, Stephane Passignat
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.


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

   

org.apache.commons:commons-email:1.5
   

 
  



thank you

Stéphane


-
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


--
*Stéphane Passignat*
✆ +33 6 62 57 47 86 
✉ passig...@hotmail.com
📍 3 place Jacques Marette, 75015 PARIS 


Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-23 Thread Tamás Cservenák
Stephane,

"I need to add a library to maven classpath" -> you declare it as a
dependency, or I don't get quite the problem (looking at your last but also
first mail)
You can declare the artifact as project dependency (POM/dependencies) or as
plugin dependency (surefire/dependency), which one is the one you want?

To make maven able to use your new layout, did you try ,mvn/extensions.xml ?
https://maven.apache.org/guides/mini/guide-using-extensions.html

HTH
Tamas


On Wed, Feb 22, 2023 at 11:12 PM Stephane Passignat 
wrote:

> Hello,
>
> thank you everyone for these suggestions. Let's go back to my original
> issue.
>
> I need to add a library to maven classpath. The library I need is
> another RepositoryLayoutFactory, to download artifact located is a
> repository which is not yet supported by Maven. Actually it's a basic
> HTTP server. (It could be an FTP server or a database accessed is JDBC...)
>
> The library is made, it works (as well as I need), but to use it I need
> to add it to maven/lib/ext which is not portable to other computer. So
> I'm looking at alternatives. Surefire could be a candidate, or not...
>
>
> I hope this helps to understand.
>
> regards,
>
>
> Stephane
>
>
> Le 2023-02-16 à 11:58, Olivier Lamy a écrit :
> > On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
> >> On Thu, 16 Feb 2023 at 20:07, Delany
> wrote:
> >>> Hi Stephane,
> >>>
> >>> You can do like this
> >>>
> >>>  
> >>>maven-surefire-plugin
> >>>3.0.0-M9
> >>>
> >>>  
> >>>org.apache.commons
> >>>commons-email
> >>>1.5
> >>>  
> >>>
> >>>  
> >> 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.
> >>
> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
> >>
> >> 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
> )
> >>
> > a real example here :)
> >
> https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
> >
> >> hth
> >> Olivier
> >>
> >>> On Thu, 16 Feb 2023 at 11:25, Stephane Passignat >
> >>> 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.
> 
>  
>   
>  
> org.apache.maven.plugins
> maven-surefire-plugin
> 3.0.0-M9
> 
>    
> 
> 
> org.apache.commons:commons-email:1.5
>    
> 
>  
>   
>  
> 
> 
>  thank you
> 
>  Stéphane
> 
> > -
> > To unsubscribe, e-mail:users-unsubscr...@maven.apache.org
> > For additional commands, e-mail:users-h...@maven.apache.org
> >
> --
> *Stéphane Passignat*
> ✆ +33 6 62 57 47 86 
> ✉ passig...@hotmail.com
> 📍 3 place Jacques Marette, 75015 PARIS
> 


Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-23 Thread Alexander Kriegisch
Would you not rather write a Maven plugin or extension for something
like that and hook it into the build process globally, so you can use it
when specifying `repository` or `pluginReporitory` entries in the POM
needing it? This does not seem to be something limited to certain
plugins, if I understand correctly.

Alexander Kriegisch
https://scrum-master.de


Stephane Passignat schrieb am 22.02.2023 um 11:27:
> Hello,
> 
> thank you everyone for these suggestions. Let's go back to my original 
> issue.
> 
> I need to add a library to maven classpath. The library I need is 
> another RepositoryLayoutFactory, to download artifact located is a 
> repository which is not yet supported by Maven. Actually it's a basic 
> HTTP server. (It could be an FTP server or a database accessed is JDBC...)
> 
> The library is made, it works (as well as I need), but to use it I need 
> to add it to maven/lib/ext which is not portable to other computer. So 
> I'm looking at alternatives. Surefire could be a candidate, or not...
> 
> 
> I hope this helps to understand.
> 
> regards,
> 
> 
> Stephane
> 
> 
> Le 2023-02-16 à 11:58, Olivier Lamy a écrit :
>> On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
>>> On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
 Hi Stephane,

 You can do like this

  
maven-surefire-plugin
3.0.0-M9

  
org.apache.commons
commons-email
1.5
  

  
>>> 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.
>>> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
>>>
>>> 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)
>>>
>> a real example here :)
>> https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
>>
>>> hth
>>> Olivier
>>>
 On Thu, 16 Feb 2023 at 11:25, Stephane Passignat
 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.
>
> 
>  
> 
>org.apache.maven.plugins
>maven-surefire-plugin
>3.0.0-M9
>
>   
>
> org.apache.commons:commons-email:1.5
>   
>
> 
>  
> 
>
>
> thank you
>
> Stéphane
>
>> -
>> 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



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-22 Thread Stephane Passignat

Hello,

thank you everyone for these suggestions. Let's go back to my original 
issue.


I need to add a library to maven classpath. The library I need is 
another RepositoryLayoutFactory, to download artifact located is a 
repository which is not yet supported by Maven. Actually it's a basic 
HTTP server. (It could be an FTP server or a database accessed is JDBC...)


The library is made, it works (as well as I need), but to use it I need 
to add it to maven/lib/ext which is not portable to other computer. So 
I'm looking at alternatives. Surefire could be a candidate, or not...



I hope this helps to understand.

regards,


Stephane


Le 2023-02-16 à 11:58, Olivier Lamy a écrit :

On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:

On Thu, 16 Feb 2023 at 20:07, Delany  wrote:

Hi Stephane,

You can do like this

 
   maven-surefire-plugin
   3.0.0-M9
   
 
   org.apache.commons
   commons-email
   1.5
 
   
 

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.
${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar

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)


a real example here :)
https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml


hth
Olivier


On Thu, 16 Feb 2023 at 11:25, Stephane Passignat
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.


 

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

org.apache.commons:commons-email:1.5
  
   

 



thank you

Stéphane


-
To unsubscribe, e-mail:users-unsubscr...@maven.apache.org
For additional commands, e-mail:users-h...@maven.apache.org


--
*Stéphane Passignat*
✆ +33 6 62 57 47 86 
✉ passig...@hotmail.com
📍 3 place Jacques Marette, 75015 PARIS 


Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Delany
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

-   
-   org.apache.maven.plugins
-   maven-surefire-plugin
-   ${surefire.version} 
-   
-   
-
com.myco.app:foo-core:test-jar:tests
-   
-   

Delany

On Thu, 16 Feb 2023 at 12:53, Olivier Lamy  wrote:

> On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
> >
> > Hi Stephane,
> >
> > You can do like this
> >
> > 
> >   maven-surefire-plugin
> >   3.0.0-M9
> >   
> > 
> >   org.apache.commons
> >   commons-email
> >   1.5
> > 
> >   
> > 
>
> 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.
>
> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
>
> 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 
> > 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.
> > >
> > > 
> > > 
> > >
> > >   org.apache.maven.plugins
> > >   maven-surefire-plugin
> > >   3.0.0-M9
> > >   
> > >  
> > >
> > >
> org.apache.commons:commons-email:1.5
> > >  
> > >   
> > >
> > > 
> > > 
> > >
> > >
> > > thank you
> > >
> > > Stéphane
> > >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Mikael Åsberg
I agree that the current syntax for adding to stuff to test runtime is
clunky and I wouldn't personally use it unless I needed to.

On Thu, Feb 16, 2023 at 1:07 PM Alexander Kriegisch
 wrote:
>
> Which is exactly why I was asking. I want to learn about real-world use
> cases which would require such a thing, not be just nice to have.
> Over-engineering POMs does not make them more readable or maintainable.
>
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Mikael Åsberg schrieb am 16.02.2023 um 13:03:
> > I use runtime scope a lot, but personally can't recall having needed
> > the equivalent of a test-runtime scope myself (or, more likely, I
> > could get away with test compile scope even though the dependency was
> > only needed at test runtime). But just because I haven't needed it
> > doesn't mean there are no legit circumstances.
> >
> > On Thu, Feb 16, 2023 at 12:57 PM Alexander Kriegisch
> >  wrote:
> >>
> >> For a test, does it really matter to make the dependency test-scoped?
> >>
> >> Mikael Åsberg schrieb am 16.02.2023 um 12:35:
> >>> Because there exists runtime, but no test only runtime 
> >>> scope
> >>>
> >>> On Thu, Feb 16, 2023 at 12:22 PM Alexander Kriegisch
> >>>  wrote:
> 
>  I would be more interested first in why this should be necessary at all.
>  What is the use case that would not be covered by declaring a regular
>  test-scoped dependency in the module?
>  --
>  Alexander Kriegisch
>  https://scrum-master.de
> 
> 
>  Olivier Lamy schrieb am 16.02.2023 um 11:58:
> > On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
> >>
> >> On Thu, 16 Feb 2023 at 20:07, Delany  
> >> wrote:
> >>>
> >>> Hi Stephane,
> >>>
> >>> You can do like this
> >>>
> >>> 
> >>>   maven-surefire-plugin
> >>>   3.0.0-M9
> >>>   
> >>> 
> >>>   org.apache.commons
> >>>   commons-email
> >>>   1.5
> >>> 
> >>>   
> >>> 
> >>
> >> 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.
> >> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
> >>
> >> 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)
> >>
> >
> > a real example here :)
> > https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
> >
> >> hth
> >> Olivier
> >>
> >>>
> >>> On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
> >>> 
> >>> 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.
> 
>  
>  
> 
>    org.apache.maven.plugins
>    maven-surefire-plugin
>    3.0.0-M9
>    
>   
> 
>  org.apache.commons:commons-email:1.5
>   
>    
> 
>  
>  
> 
> 
>  thank you
> 
>  Stéphane
> 
> >
> > -
> > 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
> >>>
> >>
> >> -
> >> 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
> >
>
> 

Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Alexander Kriegisch
Which is exactly why I was asking. I want to learn about real-world use
cases which would require such a thing, not be just nice to have.
Over-engineering POMs does not make them more readable or maintainable.

Alexander Kriegisch
https://scrum-master.de


Mikael Åsberg schrieb am 16.02.2023 um 13:03:
> I use runtime scope a lot, but personally can't recall having needed
> the equivalent of a test-runtime scope myself (or, more likely, I
> could get away with test compile scope even though the dependency was
> only needed at test runtime). But just because I haven't needed it
> doesn't mean there are no legit circumstances.
> 
> On Thu, Feb 16, 2023 at 12:57 PM Alexander Kriegisch
>  wrote:
>>
>> For a test, does it really matter to make the dependency test-scoped?
>>
>> Mikael Åsberg schrieb am 16.02.2023 um 12:35:
>>> Because there exists runtime, but no test only runtime scope
>>>
>>> On Thu, Feb 16, 2023 at 12:22 PM Alexander Kriegisch
>>>  wrote:

 I would be more interested first in why this should be necessary at all.
 What is the use case that would not be covered by declaring a regular
 test-scoped dependency in the module?
 --
 Alexander Kriegisch
 https://scrum-master.de


 Olivier Lamy schrieb am 16.02.2023 um 11:58:
> On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
>>
>> On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
>>>
>>> Hi Stephane,
>>>
>>> You can do like this
>>>
>>> 
>>>   maven-surefire-plugin
>>>   3.0.0-M9
>>>   
>>> 
>>>   org.apache.commons
>>>   commons-email
>>>   1.5
>>> 
>>>   
>>> 
>>
>> 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.
>> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
>>
>> 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)
>>
>
> a real example here :)
> https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
>
>> hth
>> Olivier
>>
>>>
>>> On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
>>> 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.

 
 

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

 org.apache.commons:commons-email:1.5
  
   

 
 


 thank you

 Stéphane

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



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Mikael Åsberg
I use runtime scope a lot, but personally can't recall having needed
the equivalent of a test-runtime scope myself (or, more likely, I
could get away with test compile scope even though the dependency was
only needed at test runtime). But just because I haven't needed it
doesn't mean there are no legit circumstances.

On Thu, Feb 16, 2023 at 12:57 PM Alexander Kriegisch
 wrote:
>
> For a test, does it really matter to make the dependency test-scoped?
>
> Mikael Åsberg schrieb am 16.02.2023 um 12:35:
> > Because there exists runtime, but no test only runtime scope
> >
> > On Thu, Feb 16, 2023 at 12:22 PM Alexander Kriegisch
> >  wrote:
> >>
> >> I would be more interested first in why this should be necessary at all.
> >> What is the use case that would not be covered by declaring a regular
> >> test-scoped dependency in the module?
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >>
> >> Olivier Lamy schrieb am 16.02.2023 um 11:58:
> >>> On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
> 
>  On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
> >
> > Hi Stephane,
> >
> > You can do like this
> >
> > 
> >   maven-surefire-plugin
> >   3.0.0-M9
> >   
> > 
> >   org.apache.commons
> >   commons-email
> >   1.5
> > 
> >   
> > 
> 
>  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.
>  ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
> 
>  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)
> 
> >>>
> >>> a real example here :)
> >>> https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
> >>>
>  hth
>  Olivier
> 
> >
> > On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
> > 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.
> >>
> >> 
> >> 
> >>
> >>   org.apache.maven.plugins
> >>   maven-surefire-plugin
> >>   3.0.0-M9
> >>   
> >>  
> >>
> >> org.apache.commons:commons-email:1.5
> >>  
> >>   
> >>
> >> 
> >> 
> >>
> >>
> >> thank you
> >>
> >> Stéphane
> >>
> >>>
> >>> -
> >>> 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
> >
>
> -
> 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



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Alexander Kriegisch
For a test, does it really matter to make the dependency test-scoped?

Mikael Åsberg schrieb am 16.02.2023 um 12:35:
> Because there exists runtime, but no test only runtime scope
> 
> On Thu, Feb 16, 2023 at 12:22 PM Alexander Kriegisch
>  wrote:
>>
>> I would be more interested first in why this should be necessary at all.
>> What is the use case that would not be covered by declaring a regular
>> test-scoped dependency in the module?
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>>
>> Olivier Lamy schrieb am 16.02.2023 um 11:58:
>>> On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:

 On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
>
> Hi Stephane,
>
> You can do like this
>
> 
>   maven-surefire-plugin
>   3.0.0-M9
>   
> 
>   org.apache.commons
>   commons-email
>   1.5
> 
>   
> 

 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.
 ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar

 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)

>>>
>>> a real example here :)
>>> https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
>>>
 hth
 Olivier

>
> On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
> 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.
>>
>> 
>> 
>>
>>   org.apache.maven.plugins
>>   maven-surefire-plugin
>>   3.0.0-M9
>>   
>>  
>>
>> org.apache.commons:commons-email:1.5
>>  
>>   
>>
>> 
>> 
>>
>>
>> thank you
>>
>> Stéphane
>>
>>>
>>> -
>>> 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
> 

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Mikael Åsberg
Because there exists runtime, but no test only runtime scope

On Thu, Feb 16, 2023 at 12:22 PM Alexander Kriegisch
 wrote:
>
> I would be more interested first in why this should be necessary at all.
> What is the use case that would not be covered by declaring a regular
> test-scoped dependency in the module?
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Olivier Lamy schrieb am 16.02.2023 um 11:58:
> > On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
> >>
> >> On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
> >>>
> >>> Hi Stephane,
> >>>
> >>> You can do like this
> >>>
> >>> 
> >>>   maven-surefire-plugin
> >>>   3.0.0-M9
> >>>   
> >>> 
> >>>   org.apache.commons
> >>>   commons-email
> >>>   1.5
> >>> 
> >>>   
> >>> 
> >>
> >> 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.
> >> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
> >>
> >> 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)
> >>
> >
> > a real example here :)
> > https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
> >
> >> hth
> >> Olivier
> >>
> >>>
> >>> On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
> >>> 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.
> 
>  
>  
> 
>    org.apache.maven.plugins
>    maven-surefire-plugin
>    3.0.0-M9
>    
>   
> 
>  org.apache.commons:commons-email:1.5
>   
>    
> 
>  
>  
> 
> 
>  thank you
> 
>  Stéphane
> 
> >
> > -
> > 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



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Alexander Kriegisch
I would be more interested first in why this should be necessary at all.
What is the use case that would not be covered by declaring a regular
test-scoped dependency in the module?
--
Alexander Kriegisch
https://scrum-master.de


Olivier Lamy schrieb am 16.02.2023 um 11:58:
> On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
>>
>> On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
>>>
>>> Hi Stephane,
>>>
>>> You can do like this
>>>
>>> 
>>>   maven-surefire-plugin
>>>   3.0.0-M9
>>>   
>>> 
>>>   org.apache.commons
>>>   commons-email
>>>   1.5
>>> 
>>>   
>>> 
>>
>> 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.
>> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
>>
>> 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)
>>
> 
> a real example here :)
> https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml
> 
>> hth
>> Olivier
>>
>>>
>>> On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
>>> 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.

 
 

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

 org.apache.commons:commons-email:1.5
  
   

 
 


 thank you

 Stéphane

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



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Olivier Lamy
On Thu, 16 Feb 2023 at 20:52, Olivier Lamy  wrote:
>
> On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
> >
> > Hi Stephane,
> >
> > You can do like this
> >
> > 
> >   maven-surefire-plugin
> >   3.0.0-M9
> >   
> > 
> >   org.apache.commons
> >   commons-email
> >   1.5
> > 
> >   
> > 
>
> 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.
> ${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar
>
> 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)
>

a real example here :)
https://github.com/apache/maven-surefire/blob/master/surefire-providers/common-junit48/pom.xml

> hth
> Olivier
>
> >
> > On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
> > 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.
> > >
> > > 
> > > 
> > >
> > >   org.apache.maven.plugins
> > >   maven-surefire-plugin
> > >   3.0.0-M9
> > >   
> > >  
> > >
> > > org.apache.commons:commons-email:1.5
> > >  
> > >   
> > >
> > > 
> > > 
> > >
> > >
> > > thank you
> > >
> > > Stéphane
> > >

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Olivier Lamy
On Thu, 16 Feb 2023 at 20:07, Delany  wrote:
>
> Hi Stephane,
>
> You can do like this
>
> 
>   maven-surefire-plugin
>   3.0.0-M9
>   
> 
>   org.apache.commons
>   commons-email
>   1.5
> 
>   
> 

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.
${settings.localRepository}/org/apache/commons/commons-email/1.5/commons-email-1.5.jar

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 
> 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.
> >
> > 
> > 
> >
> >   org.apache.maven.plugins
> >   maven-surefire-plugin
> >   3.0.0-M9
> >   
> >  
> >
> > org.apache.commons:commons-email:1.5
> >  
> >   
> >
> > 
> > 
> >
> >
> > thank you
> >
> > Stéphane
> >

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



Re: maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Delany
Hi Stephane,

You can do like this


  maven-surefire-plugin
  3.0.0-M9
  

  org.apache.commons
  commons-email
  1.5

  


On Thu, 16 Feb 2023 at 11:25, Stephane Passignat 
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.
>
> 
> 
>
>   org.apache.maven.plugins
>   maven-surefire-plugin
>   3.0.0-M9
>   
>  
>
> org.apache.commons:commons-email:1.5
>  
>   
>
> 
> 
>
>
> thank you
>
> Stéphane
>


maven-surefire-plugin add artifact as additionalClasspathElement

2023-02-16 Thread Stephane Passignat

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.



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

   
org.apache.commons:commons-email:1.5

 
  
   



thank you

Stéphane