Re: how to get latest plugin-version using mvn versions:display-plugin-updates?

2022-07-25 Thread Delany
Always force an update with the -U switch.
Delany

On Tue, 26 Jul 2022, 06:55 Stephan Wissel,  wrote:

> When I run
>
> mvn versions:display-plugin-updates
>
> on my project, I get the result:
>
> [*INFO*] All plugins with a version specified are using the latest
> versions.
>
> [*INFO*]
>
> [*INFO*] All plugins have a version specified.
>
> [*INFO*]
>
> [*INFO*] Project requires minimum Maven version for build of: 3.8.1
>
> [*INFO*] Plugins require minimum Maven version of: null
>
> [*INFO*]
>
> [*INFO*] No plugins require a newer version of Maven than specified by the
> pom.
>
> However when checking maven central, I find newer versions of the plugins
> used.
> (e.g. spotless-maven-plugin -> 2.22.8 -> 2.23.0)
> What do I miss?
>
> Create a nice day!
> Stephan H. Wissel
>
> Blog  Twitter  >
> LinkedIn  Xing
> 
>


how to get latest plugin-version using mvn versions:display-plugin-updates?

2022-07-25 Thread Stephan Wissel
When I run

mvn versions:display-plugin-updates

on my project, I get the result:

[*INFO*] All plugins with a version specified are using the latest versions.

[*INFO*]

[*INFO*] All plugins have a version specified.

[*INFO*]

[*INFO*] Project requires minimum Maven version for build of: 3.8.1

[*INFO*] Plugins require minimum Maven version of: null

[*INFO*]

[*INFO*] No plugins require a newer version of Maven than specified by the
pom.

However when checking maven central, I find newer versions of the plugins
used.
(e.g. spotless-maven-plugin -> 2.22.8 -> 2.23.0)
What do I miss?

Create a nice day!
Stephan H. Wissel

Blog  Twitter 
LinkedIn  Xing



Re: java.lang.ClassNotFoundException: com.google.common.base.Preconditions

2022-07-25 Thread Bernd Eckenfels
The problem is how your app (or the memory measuit lib) is loading classes. It 
does not seem to use the classloader from your application main class (which is 
the one maven provides prepared with your dependencies).

 Maybe it helps to set the thread context classloader with the app classloader 
(not sure if the maven plugin does that or not). But it might just not be 
possible to make your external code use this classloader, in that case starting 
a stand alone java might be easier.

Gruss
Bernd


--
http://bernd.eckenfels.net

Von: Siddharth Jain 
Gesendet: Monday, July 25, 2022 2:13:30 AM
An: Maven Users List 
Betreff: Re: java.lang.ClassNotFoundException: 
com.google.common.base.Preconditions

could you explain this to me? we have tried running without configuring any
agent
mvn exec:java -X -Dexec.mainClass=com.example.App

and the exception is still there. and maven:exec works for other projects.

On Sun, Jul 24, 2022 at 1:19 PM Bernd Eckenfels 
wrote:

> Since exec:java executes in the running JVM it does not reconfigure the
> (boot)classpath but provides a configured classloader. It looks like the
> measuring agent does not like that. In that Case you need either
> exec:exec or a plug-in for that purpose.
>
> Gruss
> Bernd
>
>
> --
> http://bernd.eckenfels.net
> 
> Von: Siddharth Jain 
> Gesendet: Sunday, July 24, 2022 8:46:04 PM
> An: users@maven.apache.org 
> Betreff: java.lang.ClassNotFoundException:
> com.google.common.base.Preconditions
>
> we are running into the dreaded ClassNotFoundException in a project. Here
> is the setup. Using JDK 11 and Maven 3.8.5. Trying to create sample test
> project that uses memory-measurer
>  to measure memory.
> First we mvn packaged and installed the memory-measurer artifact into M2
> repository. Then we created a test project in which we add dependency on
> memory-measurer. The project compiles fine but gives error on running (we
> run using mvn exec:java plugin):
>
> Caused by: java.lang.ClassNotFoundException:
> com.google.common.base.Preconditions
> at jdk.internal.loader.BuiltinClassLoader.loadClass
> (BuiltinClassLoader.java:581)
> at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass
> (ClassLoaders.java:178)
> at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
> at objectexplorer.InstrumentationGrabber.checkSetup
> (InstrumentationGrabber.java:20)
> at objectexplorer.InstrumentationGrabber.instrumentation
> (InstrumentationGrabber.java:25)
> at objectexplorer.MemoryMeasurer. (MemoryMeasurer.java:24)
> at com.example.App.main (App.java:20)
> at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
> at java.lang.Thread.run (Thread.java:834)
>
>
> What have we tried? Here is output of mvn dependency:build-classpath:
>
>
> /Users/xxx/.m2/repository/objectexplorer/memory-measurer/1.0-SNAPSHOT/memory-measurer-1.0-SNAPSHOT.jar:/Users/xxx/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/xxx/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/Users/xxx/.m2/repository/junit/junit/4.11/junit-4.11.jar:/Users/xxx/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
>
> we unpacked guava-19.0.jar in a temp directory and can see
>
> -rw-r--r--  1 xxx  staff  5252 Aug 25  2014
> /Users/xxx/temp/com/google/common/base/Preconditions.class
>
> in it. The next thing we tried is printing
> System.getProperty("java.class.path"). This gives:
>
> /Library/Downloads/apache-maven-3.8.5/boot/plexus-classworlds-2.6.0.jar
>
> above does not contain the classpath calculated by mvn dependency plugin.
> Question 1: Why?
>
> Question 2: When we printed System.getProperty("java.class.path") in
> another working project we got same result. It seems the classpath when
> using mvn exec:java is always
>
> /Library/Downloads/apache-maven-3.8.5/boot/plexus-classworlds-2.6.0.jar
>
> How is the other project able to load classes from above classpath? Why is
> mvn
> exec:java not using correct classpath? How do we fix this?
>
>
> Here 
> is
> output of maven with the -X switch. You can see following debug info:
>
>
> [DEBUG] Adding project dependency artifact: memory-measurer to classpath
> [DEBUG] Adding project dependency artifact: jsr305 to classpath
> *[DEBUG] Adding project dependency artifact: guava to classpath* here
>  is
> pom.xml. would be great if someone could help us out.
>


[ANN] Maven Resources Plugin 3.3.0 released

2022-07-25 Thread Michael Osipov

Subject: [ANN] Maven Resources Plugin 3.3.0 released

The Apache Maven team is pleased to announce the release of the Maven 
Resources Plugin version 3.3.0.


https://maven.apache.org/plugins/maven-resources-plugin/

You should specify the version in your project's plugin configuration:


  org.apache.maven.plugins
  maven-resources-plugin
  3.3.0



Release Notes - Maven Resources Plugin - Version 3.3.0

** Bug
* [MRESOURCES-237] - Resource plugin's handling of symbolic links 
changed in 3.0.x, broke existing behavior

* [MRESOURCES-265] - Resource copying not using specified encoding
* [MRESOURCES-268] - java.nio.charset.MalformedInputException: 
Input length = 1

* [MRESOURCES-269] - Symlinks cause copying resources to fail
* [MRESOURCES-273] - Filtering of Maven properties with long names 
is not working after transition from 2.6 to 3.2.0
* [MRESOURCES-275] - valid location for directory parameter is 
always required


** New Feature
* [MRESOURCES-250] - Add ability to flatten folder structure into 
target directory when copying resources


** Task
* [MRESOURCES-277] - Update plugin (requires Maven 3.2.5+)
* [MRESOURCES-283] - Require Java 8

** Dependency upgrade
* [MRESOURCES-282] - Upgrade maven-plugin parent to 36
* [MRESOURCES-286] - Upgrade Maven Filtering to 3.3.0


Enjoy,

-The Apache Maven team

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



Re: java.lang.ClassNotFoundException: com.google.common.base.Preconditions

2022-07-25 Thread Martin Gainty

Ability to add additional jars are configured with these 2 parameters


true 


true 



full example located at
java - Maven exec:exec - Need additional classpath elements for plugin - Stack 
Overflow
[https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-i...@2.png?v=73d79a89bded]
Maven exec:exec - Need additional classpath elements for 
plugin
Turns out there are 2 options that you can use with Maven when using exec:java 
(which is what I wanted). You can specify true/false for each:
stackoverflow.com
Gruss
martin~

From: Siddharth Jain 
Sent: Monday, July 25, 2022 11:22 AM
To: Maven Users List 
Subject: Re: java.lang.ClassNotFoundException: 
com.google.common.base.Preconditions

I understand that. But we have been using maven exec:java for other
projects and did not run into this exception with them. *So we want to
understand why its not working here?* the debug log also shows that guava
is added to the classpath. how can we debug this issue further? could this
be a bug in maven? thanks.

On Mon, Jul 25, 2022 at 3:49 AM Martin Gainty  wrote:

> He advised you to not use exec:java which uses a configured classloader
> He advised you use exec:exec
>
> Directions to use exec:exec provided here
> Exec Maven Plugin – exec:exec (mojohaus.org)<
> https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html>
>
> Exec Maven Plugin - MojoHaus<
> https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html>
> The executable. Can be a full path or the name of the executable. In the
> latter case, the executable must be in the PATH for the execution to work.
> www.mojohaus.org
> gruss
> Martin
> 
> From: Siddharth Jain 
> Sent: Sunday, July 24, 2022 8:13 PM
> To: Maven Users List 
> Subject: Re: java.lang.ClassNotFoundException:
> com.google.common.base.Preconditions
>
> could you explain this to me? we have tried running without configuring any
> agent
> mvn exec:java -X -Dexec.mainClass=com.example.App
>
> and the exception is still there. and maven:exec works for other projects.
>
> On Sun, Jul 24, 2022 at 1:19 PM Bernd Eckenfels 
> wrote:
>
> > Since exec:java executes in the running JVM it does not reconfigure the
> > (boot)classpath but provides a configured classloader. It looks like the
> > measuring agent does not like that. In that Case you need either
> > exec:exec or a plug-in for that purpose.
> >
> > Gruss
> > Bernd
> >
> >
> > --
> > http://bernd.eckenfels.net
> > 
> > Von: Siddharth Jain 
> > Gesendet: Sunday, July 24, 2022 8:46:04 PM
> > An: users@maven.apache.org 
> > Betreff: java.lang.ClassNotFoundException:
> > com.google.common.base.Preconditions
> >
> > we are running into the dreaded ClassNotFoundException in a project. Here
> > is the setup. Using JDK 11 and Maven 3.8.5. Trying to create sample test
> > project that uses memory-measurer
> >  to measure memory.
> > First we mvn packaged and installed the memory-measurer artifact into M2
> > repository. Then we created a test project in which we add dependency on
> > memory-measurer. The project compiles fine but gives error on running (we
> > run using mvn exec:java plugin):
> >
> > Caused by: java.lang.ClassNotFoundException:
> > com.google.common.base.Preconditions
> > at jdk.internal.loader.BuiltinClassLoader.loadClass
> > (BuiltinClassLoader.java:581)
> > at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass
> > (ClassLoaders.java:178)
> > at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
> > at objectexplorer.InstrumentationGrabber.checkSetup
> > (InstrumentationGrabber.java:20)
> > at objectexplorer.InstrumentationGrabber.instrumentation
> > (InstrumentationGrabber.java:25)
> > at objectexplorer.MemoryMeasurer. (MemoryMeasurer.java:24)
> > at com.example.App.main (App.java:20)
> > at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
> > at java.lang.Thread.run (Thread.java:834)
> >
> >
> > What have we tried? Here is output of mvn dependency:build-classpath:
> >
> >
> >
> /Users/xxx/.m2/repository/objectexplorer/memory-measurer/1.0-SNAPSHOT/memory-measurer-1.0-SNAPSHOT.jar:/Users/xxx/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/xxx/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/Users/xxx/.m2/repository/junit/junit/4.11/junit-4.11.jar:/Users/xxx/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
> >
> > we unpacked guava-19.0.jar in a temp directory and can see
> >
> > -rw-r--r--  1 

Re: java.lang.ClassNotFoundException: com.google.common.base.Preconditions

2022-07-25 Thread Siddharth Jain
I understand that. But we have been using maven exec:java for other
projects and did not run into this exception with them. *So we want to
understand why its not working here?* the debug log also shows that guava
is added to the classpath. how can we debug this issue further? could this
be a bug in maven? thanks.

On Mon, Jul 25, 2022 at 3:49 AM Martin Gainty  wrote:

> He advised you to not use exec:java which uses a configured classloader
> He advised you use exec:exec
>
> Directions to use exec:exec provided here
> Exec Maven Plugin – exec:exec (mojohaus.org)<
> https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html>
>
> Exec Maven Plugin - MojoHaus<
> https://www.mojohaus.org/exec-maven-plugin/exec-mojo.html>
> The executable. Can be a full path or the name of the executable. In the
> latter case, the executable must be in the PATH for the execution to work.
> www.mojohaus.org
> gruss
> Martin
> 
> From: Siddharth Jain 
> Sent: Sunday, July 24, 2022 8:13 PM
> To: Maven Users List 
> Subject: Re: java.lang.ClassNotFoundException:
> com.google.common.base.Preconditions
>
> could you explain this to me? we have tried running without configuring any
> agent
> mvn exec:java -X -Dexec.mainClass=com.example.App
>
> and the exception is still there. and maven:exec works for other projects.
>
> On Sun, Jul 24, 2022 at 1:19 PM Bernd Eckenfels 
> wrote:
>
> > Since exec:java executes in the running JVM it does not reconfigure the
> > (boot)classpath but provides a configured classloader. It looks like the
> > measuring agent does not like that. In that Case you need either
> > exec:exec or a plug-in for that purpose.
> >
> > Gruss
> > Bernd
> >
> >
> > --
> > http://bernd.eckenfels.net
> > 
> > Von: Siddharth Jain 
> > Gesendet: Sunday, July 24, 2022 8:46:04 PM
> > An: users@maven.apache.org 
> > Betreff: java.lang.ClassNotFoundException:
> > com.google.common.base.Preconditions
> >
> > we are running into the dreaded ClassNotFoundException in a project. Here
> > is the setup. Using JDK 11 and Maven 3.8.5. Trying to create sample test
> > project that uses memory-measurer
> >  to measure memory.
> > First we mvn packaged and installed the memory-measurer artifact into M2
> > repository. Then we created a test project in which we add dependency on
> > memory-measurer. The project compiles fine but gives error on running (we
> > run using mvn exec:java plugin):
> >
> > Caused by: java.lang.ClassNotFoundException:
> > com.google.common.base.Preconditions
> > at jdk.internal.loader.BuiltinClassLoader.loadClass
> > (BuiltinClassLoader.java:581)
> > at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass
> > (ClassLoaders.java:178)
> > at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
> > at objectexplorer.InstrumentationGrabber.checkSetup
> > (InstrumentationGrabber.java:20)
> > at objectexplorer.InstrumentationGrabber.instrumentation
> > (InstrumentationGrabber.java:25)
> > at objectexplorer.MemoryMeasurer. (MemoryMeasurer.java:24)
> > at com.example.App.main (App.java:20)
> > at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
> > at java.lang.Thread.run (Thread.java:834)
> >
> >
> > What have we tried? Here is output of mvn dependency:build-classpath:
> >
> >
> >
> /Users/xxx/.m2/repository/objectexplorer/memory-measurer/1.0-SNAPSHOT/memory-measurer-1.0-SNAPSHOT.jar:/Users/xxx/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/xxx/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/Users/xxx/.m2/repository/junit/junit/4.11/junit-4.11.jar:/Users/xxx/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
> >
> > we unpacked guava-19.0.jar in a temp directory and can see
> >
> > -rw-r--r--  1 xxx  staff  5252 Aug 25  2014
> > /Users/xxx/temp/com/google/common/base/Preconditions.class
> >
> > in it. The next thing we tried is printing
> > System.getProperty("java.class.path"). This gives:
> >
> > /Library/Downloads/apache-maven-3.8.5/boot/plexus-classworlds-2.6.0.jar
> >
> > above does not contain the classpath calculated by mvn dependency plugin.
> > Question 1: Why?
> >
> > Question 2: When we printed System.getProperty("java.class.path") in
> > another working project we got same result. It seems the classpath when
> > using mvn exec:java is always
> >
> > /Library/Downloads/apache-maven-3.8.5/boot/plexus-classworlds-2.6.0.jar
> >
> > How is the other project able to load classes from above classpath? Why
> is
> > mvn
> > exec:java not using correct classpath? How do we fix this?
> >
> >
> > Here 
> > is
> > output of maven with the -X switch. You can see following debug info:
> >
> >
> > [DEBUG] Adding project dependency artifact: memory-measurer to classpath
> > [DEBUG] Adding project dependency artifact: jsr305 to 

[ANN] Maven Site Plugin 4.0.0-M3 released

2022-07-25 Thread Michael Osipov
The Apache Maven team is pleased to announce the release of the Maven 
Site Plugin, version 4.0.0-M3.


https://maven.apache.org/plugins/maven-site-plugin/


Release Notes - Maven Site Plugin - Version 4.0.0-M3

** Dependency upgrade
* [MSITE-905] - Upgrade Doxia and Maven Reporting stack
* [MSITE-906] - Upgrade plugins and components


Enjoy,

-The Apache Maven team

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



Re: java.lang.ClassNotFoundException: com.google.common.base.Preconditions

2022-07-25 Thread Martin Gainty
He advised you to not use exec:java which uses a configured classloader
He advised you use exec:exec

Directions to use exec:exec provided here
Exec Maven Plugin – exec:exec 
(mojohaus.org)

Exec Maven Plugin - 
MojoHaus
The executable. Can be a full path or the name of the executable. In the latter 
case, the executable must be in the PATH for the execution to work.
www.mojohaus.org
gruss
Martin

From: Siddharth Jain 
Sent: Sunday, July 24, 2022 8:13 PM
To: Maven Users List 
Subject: Re: java.lang.ClassNotFoundException: 
com.google.common.base.Preconditions

could you explain this to me? we have tried running without configuring any
agent
mvn exec:java -X -Dexec.mainClass=com.example.App

and the exception is still there. and maven:exec works for other projects.

On Sun, Jul 24, 2022 at 1:19 PM Bernd Eckenfels 
wrote:

> Since exec:java executes in the running JVM it does not reconfigure the
> (boot)classpath but provides a configured classloader. It looks like the
> measuring agent does not like that. In that Case you need either
> exec:exec or a plug-in for that purpose.
>
> Gruss
> Bernd
>
>
> --
> http://bernd.eckenfels.net
> 
> Von: Siddharth Jain 
> Gesendet: Sunday, July 24, 2022 8:46:04 PM
> An: users@maven.apache.org 
> Betreff: java.lang.ClassNotFoundException:
> com.google.common.base.Preconditions
>
> we are running into the dreaded ClassNotFoundException in a project. Here
> is the setup. Using JDK 11 and Maven 3.8.5. Trying to create sample test
> project that uses memory-measurer
>  to measure memory.
> First we mvn packaged and installed the memory-measurer artifact into M2
> repository. Then we created a test project in which we add dependency on
> memory-measurer. The project compiles fine but gives error on running (we
> run using mvn exec:java plugin):
>
> Caused by: java.lang.ClassNotFoundException:
> com.google.common.base.Preconditions
> at jdk.internal.loader.BuiltinClassLoader.loadClass
> (BuiltinClassLoader.java:581)
> at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass
> (ClassLoaders.java:178)
> at java.lang.ClassLoader.loadClass (ClassLoader.java:521)
> at objectexplorer.InstrumentationGrabber.checkSetup
> (InstrumentationGrabber.java:20)
> at objectexplorer.InstrumentationGrabber.instrumentation
> (InstrumentationGrabber.java:25)
> at objectexplorer.MemoryMeasurer. (MemoryMeasurer.java:24)
> at com.example.App.main (App.java:20)
> at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
> at java.lang.Thread.run (Thread.java:834)
>
>
> What have we tried? Here is output of mvn dependency:build-classpath:
>
>
> /Users/xxx/.m2/repository/objectexplorer/memory-measurer/1.0-SNAPSHOT/memory-measurer-1.0-SNAPSHOT.jar:/Users/xxx/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/xxx/.m2/repository/com/google/guava/guava/19.0/guava-19.0.jar:/Users/xxx/.m2/repository/junit/junit/4.11/junit-4.11.jar:/Users/xxx/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
>
> we unpacked guava-19.0.jar in a temp directory and can see
>
> -rw-r--r--  1 xxx  staff  5252 Aug 25  2014
> /Users/xxx/temp/com/google/common/base/Preconditions.class
>
> in it. The next thing we tried is printing
> System.getProperty("java.class.path"). This gives:
>
> /Library/Downloads/apache-maven-3.8.5/boot/plexus-classworlds-2.6.0.jar
>
> above does not contain the classpath calculated by mvn dependency plugin.
> Question 1: Why?
>
> Question 2: When we printed System.getProperty("java.class.path") in
> another working project we got same result. It seems the classpath when
> using mvn exec:java is always
>
> /Library/Downloads/apache-maven-3.8.5/boot/plexus-classworlds-2.6.0.jar
>
> How is the other project able to load classes from above classpath? Why is
> mvn
> exec:java not using correct classpath? How do we fix this?
>
>
> Here 
> is
> output of maven with the -X switch. You can see following debug info:
>
>
> [DEBUG] Adding project dependency artifact: memory-measurer to classpath
> [DEBUG] Adding project dependency artifact: jsr305 to classpath
> *[DEBUG] Adding project dependency artifact: guava to classpath* here
>  is
> pom.xml. would be great if someone could help us out.
>