Re: Running tests from a test jar

2021-03-31 Thread Thomas Broyer
Dependencies declared with scope=test in the original project
(google-cloud-storage) won't come in transitively, you'd have to copy/paste
them.

Ideally, if that use case were to be officially supported, the project
would have to publish the tests as a normal JAR at different coordinates,
so it would have all its dependencies with scope compile (or runtime), and
you would get them transitively.

Le mer. 31 mars 2021 à 21:59, Elliotte Rusty Harold  a
écrit :

> I'm attempting to run the tests in a test jar rather than from source,
> for reasons. That is, I set up the pom.xml like so to run the tests
> that are bundled in
> com.google.cloud:google-cloud-storage:test-jar:tests
>
>   
> 
>   
> org.apache.maven.plugins
> maven-surefire-plugin
> 3.0.0-M5
> 
>   
>
> com.google.cloud:google-cloud-storage:test-jar:tests:*
>   
> 
>   
> 
>   
>
> The problem I'm running into is that a lot, though not all,
> dependencies seem to be non-transitive. I have to manually add the
> various dependencies to the dependencies section. Is there any way
> around this?
>
> There's a more complete pom.xml here:
>
>
> https://github.com/GoogleCloudPlatform/cloud-opensource-java/pull/2003/files
>
>
>
> --
> Elliotte Rusty Harold
> elh...@ibiblio.org
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Running tests from a test jar

2021-03-31 Thread Elliotte Rusty Harold
I'm attempting to run the tests in a test jar rather than from source,
for reasons. That is, I set up the pom.xml like so to run the tests
that are bundled in
com.google.cloud:google-cloud-storage:test-jar:tests

  

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

  

com.google.cloud:google-cloud-storage:test-jar:tests:*
  

  

  

The problem I'm running into is that a lot, though not all,
dependencies seem to be non-transitive. I have to manually add the
various dependencies to the dependencies section. Is there any way
around this?

There's a more complete pom.xml here:

https://github.com/GoogleCloudPlatform/cloud-opensource-java/pull/2003/files



-- 
Elliotte Rusty Harold
elh...@ibiblio.org

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



Re: How to relocate dependency classes using maven-shade-plugin?

2021-03-31 Thread Alexander Kriegisch
> Hi Dave.
> 
> I recommend to start with a simple stand-alone project in order to
> find out how Maven Shade works. It can be quite tricks for beginners
> otherwise. Create a

Typo: I mean "tricky", of course.

> POM, add a dependency - any dependency, some open source library maybe
> - and then try shading and relocating it with Maven Shade. This should
> work for both the binaries and (optionally) also for the sources. Both
> uber JARs (binaries and sources) should be pulled including transitive
> dependencies and you can even relocate the source code. Inspect the
> resulting JARs and play with filtering options (for both dependency
> names and files/directories) as well as with relocation. Then if you
> have an MCVE [1] and a concrete problem, feel free to report back
> here. Until then use [2] as a reference, especially [3] and [4]. Start
> simple and step by step, then increase the level of difficulty. Don't
> try to use 7 options at one, see what each of them does.
> 
> [1] https://stackoverflow.com/help/mcve
> [2] https://maven.apache.org/plugins/maven-shade-plugin/
> [3] 
> https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html
> [4] 
> https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html
> 
> -- 
> Alexander Kriegisch
> https://scrum-master.de
> 
> 
> David Hoffer schrieb am 31.03.2021 22:54 (GMT +07:00):
> 
>> I have a single module Maven build where one of the dependences has
>> well over 200 transitive dependencies. These transitive dependencies
>> are incompatible with the rest of my application.
>> 
>> I would like to use the maven-shade-plugin to create a shaded jar
>> uber jar that contains all of these dependencies that all have been
>> relocated to a custom package name. Then I need the Maven build to
>> include this new shaded dependency instead of the prior/regular one.
>> 
>> How can I configure the maven-shade-plugin to do this? So far I have
>> not gotten it to process dependencies at all only other project code.
>> I want it to start relocating at the top level dependency that I
>> specify and have it include all transitive ones from there.
>> 
>> Any pointers, examples are greatly appreciated.

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



Re: How to relocate dependency classes using maven-shade-plugin?

2021-03-31 Thread Alexander Kriegisch
Hi Dave.

I recommend to start with a simple stand-alone project in order to find out how 
Maven Shade works. It can be quite tricks for beginners otherwise. Create a 
POM, add a dependency - any dependency, some open source library maybe - and 
then try shading and relocating it with Maven Shade. This should work for both 
the binaries and (optionally) also for the sources. Both uber JARs (binaries 
and sources) should be pulled including transitive dependencies and you can 
even relocate the source code. Inspect the resulting JARs and play with 
filtering options (for both dependency names and files/directories) as well as 
with relocation. Then if you have an MCVE [1] and a concrete problem, feel free 
to report back here. Until then use [2] as a reference, especially [3] and [4]. 
Start simple and step by step, then increase the level of difficulty. Don't try 
to use 7 options at one, see what each of them does.

[1] https://stackoverflow.com/help/mcve
[2] https://maven.apache.org/plugins/maven-shade-plugin/
[3] 
https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html
[4] 
https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html

-- 
Alexander Kriegisch
https://scrum-master.de


David Hoffer schrieb am 31.03.2021 22:54 (GMT +07:00):

> I have a single module Maven build where one of the dependences has
> well over 200 transitive dependencies. These transitive dependencies
> are incompatible with the rest of my application.
> 
> I would like to use the maven-shade-plugin to create a shaded jar uber
> jar that contains all of these dependencies that all have been
> relocated to a custom package name. Then I need the Maven build to
> include this new shaded dependency instead of the prior/regular one.
> 
> How can I configure the maven-shade-plugin to do this? So far I have
> not gotten it to process dependencies at all only other project code.
> I want it to start relocating at the top level dependency that I
> specify and have it include all transitive ones from there.
> 
> Any pointers, examples are greatly appreciated.

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



How to relocate dependency classes using maven-shade-plugin?

2021-03-31 Thread David Hoffer
I have a single module Maven build where one of the dependences has well
over 200 transitive dependencies.  These transitive dependencies are
incompatible with the rest of my application.

I would like to use the maven-shade-plugin to create a shaded jar uber jar
that contains all of these dependencies that all have been relocated to a
custom package name.  Then I need the Maven build to include this new
shaded dependency instead of the prior/regular one.

How can I configure the maven-shade-plugin to do this?  So far I have not
gotten it to process dependencies at all only other project code.  I want
it to start relocating at the top level dependency that I specify and have
it include all transitive ones from there.

Any pointers, examples are greatly appreciated.

-Dave


Re: Core plugins, milestone versions

2021-03-31 Thread Tibor Digana
Milestone means "work in progress" and if you are continuously breaking
backwards compatibility, you can do it in multiple milestones. It does not
make sense to release multiple release versions because it's risky for
users. This email has convinced me to publish a pull request with changes
mandatory for a milestone and everybody is welcome to participate.
Cheers
Tibor

On Tue, Mar 30, 2021 at 8:03 PM Benjamin Marwell 
wrote:

> Hi Antoine,
>
> That's probably a typical YMMV question.
> From my experience with surefire, I'd say rather stick with the 2.x
> versions as long as you don't need an explicit feature of the 3.x Milestone
> version.
> If something doesn't work or is missing, open up a ticket or ask on this
> list.
>
> If you find a milestone version good enough, just post it here and ask for
> a release. We did that with the jpackage plugin and might do this with
> others as well.
>
> - Ben
>
>
> On Tue, 30 Mar 2021, 18:39 Antoine Mottier, 
> wrote:
>
> > Hello,
> >
> > While looking at https://maven.apache.org/plugins/index.html I
> > realized that many core plugin versions are actually milestone version
> > (e.g. deploy: 3.0.0-M1).
> >
> > It seems that some of them are release quite a long time ago (e.g.
> > deploy: 2018-09-23). I was wondering what is the recommendation:
> > should I use the latest version even if it is a milestone version? Or
> > should I use the latest "stable" version (e.g. 2.8.2 for deploy plugin)?
> >
> > Thanks.
> >
> > --
> > Antoine Mottier
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>