You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Elliotte Rusty Harold <el...@ibiblio.org> on 2023/03/09 12:57:19 UTC
shading in surefire
I'm curious. Why do we shade various libraries like commons-lang and
maven-shared utils in surefire?
https://github.com/apache/maven-surefire/blob/master/surefire-shared-utils/pom.xml
--
Elliotte Rusty Harold
elharo@ibiblio.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: shading in surefire
Posted by Slawomir Jaranowski <s....@gmail.com>.
Hi,
You can execute Maven test in verbose mode:
mvn test -X
next look for lines like:
[DEBUG] test(compact) classpath: test-classes classes
junit-jupiter-api-5.9.2.jar opentest4j-1.2.0.jar
junit-platform-commons-1.9.2.jar apiguardian-api-1.1.2.jar
commons-lang3-3.12.0.jar
[DEBUG] provider(compact) classpath: surefire-junit-platform-3.0.0-M9.jar
surefire-api-3.0.0-M9.jar surefire-logger-api-3.0.0-M9.jar
surefire-shared-utils-3.0.0-M9.jar common-java5-3.0.0-M9.jar
junit-platform-launcher-1.9.2.jar junit-platform-engine-1.9.2.jar
junit-jupiter-engine-5.9.2.jar
[DEBUG] boot(compact) classpath: surefire-booter-3.0.0-M9.jar
surefire-api-3.0.0-M9.jar surefire-logger-api-3.0.0-M9.jar
surefire-shared-utils-3.0.0-M9.jar surefire-extensions-spi-3.0.0-M9.jar
test-classes classes junit-jupiter-api-5.9.2.jar opentest4j-1.2.0.jar
junit-platform-commons-1.9.2.jar apiguardian-api-1.1.2.jar
commons-lang3-3.12.0.jar surefire-junit-platform-3.0.0-M9.jar
common-java5-3.0.0-M9.jar junit-platform-launcher-1.9.2.jar
junit-platform-engine-1.9.2.jar junit-jupiter-engine-5.9.2.jar
So we have:
- test(compact) classpath - artifacts available in your project
dependencies
- provider(compact) classpath - artifacts needed for executing tests with
specific provider like for JUnit 4, JUnit 5 and so on, provided by surefire
- boot(compact) classpath - final list of artifact which will be used by
new process stated by surefire
Return to first question shading is used to minimize dependencies on
provider classpath, which can conflict with test classpath
czw., 9 mar 2023 o 15:13 Eric Lilja <mi...@gmail.com> napisał(a):
> Are the providers leaking byte-buddy today? I just had to add explicit byte
> buddy to my pom-file, for Mockito to work.
>
> - Eric L
>
> On Thu, Mar 9, 2023 at 2:13 PM Slawomir Jaranowski <s.jaranowski@gmail.com
> >
> wrote:
>
> > To avoid leaking external libraries to classpath used under tests.
> >
> > But we should only use in providers and booter in plugins. We can use
> what
> > we need without shading.
> >
> > To think about what methods are used in providers, maybe we can drop it
> > anyway and use standard JDK api.
> >
> > czw., 9 mar 2023 o 13:58 Elliotte Rusty Harold <el...@ibiblio.org>
> > napisał(a):
> >
> > > I'm curious. Why do we shade various libraries like commons-lang and
> > > maven-shared utils in surefire?
> > >
> > >
> > >
> >
> https://github.com/apache/maven-surefire/blob/master/surefire-shared-utils/pom.xml
> > >
> > > --
> > > Elliotte Rusty Harold
> > > elharo@ibiblio.org
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
> > --
> > Sławomir Jaranowski
> >
>
--
Sławomir Jaranowski
Re: shading in surefire
Posted by Eric Lilja <mi...@gmail.com>.
Are the providers leaking byte-buddy today? I just had to add explicit byte
buddy to my pom-file, for Mockito to work.
- Eric L
On Thu, Mar 9, 2023 at 2:13 PM Slawomir Jaranowski <s....@gmail.com>
wrote:
> To avoid leaking external libraries to classpath used under tests.
>
> But we should only use in providers and booter in plugins. We can use what
> we need without shading.
>
> To think about what methods are used in providers, maybe we can drop it
> anyway and use standard JDK api.
>
> czw., 9 mar 2023 o 13:58 Elliotte Rusty Harold <el...@ibiblio.org>
> napisał(a):
>
> > I'm curious. Why do we shade various libraries like commons-lang and
> > maven-shared utils in surefire?
> >
> >
> >
> https://github.com/apache/maven-surefire/blob/master/surefire-shared-utils/pom.xml
> >
> > --
> > Elliotte Rusty Harold
> > elharo@ibiblio.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>
> --
> Sławomir Jaranowski
>
Re: shading in surefire
Posted by Slawomir Jaranowski <s....@gmail.com>.
To avoid leaking external libraries to classpath used under tests.
But we should only use in providers and booter in plugins. We can use what
we need without shading.
To think about what methods are used in providers, maybe we can drop it
anyway and use standard JDK api.
czw., 9 mar 2023 o 13:58 Elliotte Rusty Harold <el...@ibiblio.org>
napisał(a):
> I'm curious. Why do we shade various libraries like commons-lang and
> maven-shared utils in surefire?
>
>
> https://github.com/apache/maven-surefire/blob/master/surefire-shared-utils/pom.xml
>
> --
> Elliotte Rusty Harold
> elharo@ibiblio.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
--
Sławomir Jaranowski