Re: maven-shade-plugin not including dependencies

2022-06-28 Thread Alain Désilets
On Sun, Jun 26, 2022 at 9:49 AM Alexander Kriegisch <
alexan...@kriegisch.name> wrote:

>
> Firstly, you are not crerating a test JAR but a regular JAR with
> application classes, so of course test-scoped dependencies like JUnit
> are not going to be contained in the uber JAR.
>

Oh, right.

Secondly, you are even explicitly excluding JUnit, so how could you
> expect it to be included, even if it was not test-scoped?
>

Boy am I red in the face right now! I had copied that example from the web
and hadn't noticed the exclusion statement. Thx for pointing out the
obvious. All works now.

Alain

>
> > junit:junit
>
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>


Maven ignoring JUnit5 tests when run from command line

2020-11-24 Thread Alain Désilets
I am trying to upgrade from JUnit4 to JUnit5 and am experiencing a strange
issuewhereby:

- JUnit4 tests are fine
- JUnit5 tests work when run through intelliJ, but are ignored when run
through the maven command line

I attach a small project (zip file) that illustrates the issue. Also
attached is the output (footest.txt) of running this command:

mvn clean install > footest.txt


If you look in that file, you see a failure message for test__JUnit4Test
which proves that the test was run. But there are no failure message
for test__JUnit5Test which proves that this test was NOT run.

When I run the tests in intelliJ, I see failures for both tests which
proves that they were both run.

>From my reading, I see that several people have reported this issues but
none of the proposed fixes work for me. Any help would be appreciated.

BTW: Here is the info about my maven version

*Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)*

Maven home: /opt/apache-maven

Java version: 1.8.0_102, vendor: Oracle Corporation, runtime:
/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre

Default locale: en_CA, platform encoding: UTF-8

OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"


Thx.

Alain Désilets
[INFO] Scanning for projects...
[INFO] 
[INFO] -< ca.nrc.spikes:spike-junit >--
[INFO] Building spike-junit 1.0.0-SNAPSHOT
[INFO] [ jar ]-
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ spike-junit ---
[INFO] Deleting /Users/desilets/Documents/GitRepositories/SpikeJunit4and5/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
spike-junit ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spike-junit ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
spike-junit ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/Users/desilets/Documents/GitRepositories/SpikeJunit4and5/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
spike-junit ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to 
/Users/desilets/Documents/GitRepositories/SpikeJunit4and5/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ spike-junit ---
[INFO] Surefire report directory: 
/Users/desilets/Documents/GitRepositories/SpikeJunit4and5/target/surefire-reports

---
 T E S T S
---
Running ca.nrc.spikes.JUnit4Test
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.161 sec <<< 
FAILURE!
test__JUnit4Test(ca.nrc.spikes.JUnit4Test)  Time elapsed: 0.009 sec  <<< 
FAILURE!
java.lang.AssertionError: NEVERMIND: This failure prooves that JUnit4 tests are 
run
at org.junit.Assert.fail(Assert.java:88)
at ca.nrc.spikes.JUnit4Test.test__JUnit4Test(JUnit4Test.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at 

Re: maven-license-plugin: what does 'license-list' actually produce?

2020-05-06 Thread Alain Désilets
On Wed, May 6, 2020 at 7:10 PM Greg Chabala  wrote:

> Ah, like what you get from the standard dependency report? E.g.
>
> https://maven.apache.org/plugins/maven-dependency-plugin/dependencies.html#Licenses


Yes! Thx, that's exactly what I was looking for.

Alain


Re: maven-license-plugin: what does 'license-list' actually produce?

2020-05-06 Thread Alain Désilets
On Wed, May 6, 2020 at 6:48 PM Greg Chabala  wrote:

> Ah, I see. I believe it's closer to (A), but I would describe it as 'the
> list of licenses that the plugin knows to exist in the universe'.
>

Really? Not terribly useful. I can probably accurate version of that info
from wikipedia.


>
> I believe (B) would be the license:third-party-report goal:
> https://www.mojohaus.org/license-maven-plugin/third-party-report-mojo.html


Yeah, I ran that. But it basically gives me a long list of third-party
modules with their licenses. What I would like to see is a consolidated
"bag" of all the licenses that my project depends on. Of course, I can
manually generate that bag by consolidating the third-party-report output,
but it would be nice to have an automated way to get that.

Alain


Re: maven-license-plugin: what does 'license-list' actually produce?

2020-05-06 Thread Alain Désilets
On Wed, May 6, 2020, 4:16 PM Greg Chabala  wrote:

> The documentation has an example of the output:
>
> https://www.mojohaus.org/license-maven-plugin/examples/example-license-list.html


Yes I saw that. I just don't know how to interpret that list. Is it

(A) the list of all licenses under which I coul distribute the projet
   Or
(B) the union of all the licenses of a dependancy that the project depends
on

>
>
> On Wed, May 6, 2020 at 3:03 PM Alain Désilets 
> wrote:
>
> > The output of the license-list goal and the plugin documentation say that
> > this is a list of 'availalble licenses'.
> >
> > I am not sure what 'available' means in this context. I *believe* it
> means
> > those are the various licenses under which I could distribute the
> project.
> > But I am not sure. Can someone confirm that my understanding is correct?
> >
> > Thx.
> >
> > Alain Désilets
> >
>


maven-license-plugin: what does 'license-list' actually produce?

2020-05-06 Thread Alain Désilets
The output of the license-list goal and the plugin documentation say that
this is a list of 'availalble licenses'.

I am not sure what 'available' means in this context. I *believe* it means
those are the various licenses under which I could distribute the project.
But I am not sure. Can someone confirm that my understanding is correct?

Thx.

Alain Désilets