How to use error-prone 2.3.4 plugin with Maven

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use error-prone 2.3.4 plugin with Maven

Chris Ward
I am using Maven to build the ONOS 'trellis-t3' app. I get an unhandled exception from the Error Prone static analysis plugin (with version 2.3.3 of Error Prone). According to https://github.com/google/error-prone/issues/1940 this is fixed in version 2.3.4 of Error Prone.

How do I cause Maven to use this newer version of Error Prone ?

My build command is
docker run -it --rm -v $HOME/.m2:/root/.m2 -v $PWD:/root/trellis-t3 -w /root/trellis-t3 maven:latest mvn clean install
i.e. I'm running a Docker-packaged Maven.

If anyone wants to reproduce the error, you will need to download 'trellis-t3' with
git clone https://gerrit.onosproject.org/trellis-t3

T J (Chris) Ward, IBM Research.
Scalable Data-Centric Computing - IBM Spectrum MPI
IBM United Kingdom Ltd., Hursley Park, Winchester, Hants, SO21 2JN
011-44-1962-818679
LinkedIn
https://www.linkedin.com/in/tjcward/
ResearchGate
https://www.researchgate.net/profile/Thomas_Ward16

IBM Research -- Data Centric Systems
IBM Supercomputer Marketing

IBM Branded Products IBM Branded Swag

UNIX in the Cloud - Find A Place Where There's Room To Grow, with the original Open Standard. Free Trial Here Today
Protein Folding by Supercomputer - BlueMatter Molecular Dynamics package.
Data Tables - In-memory key-value store package.
Linux on Windows - Virtualisation package. On the Lighthouse !


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Reply | Threaded
Open this post in threaded view
|

Re: How to use error-prone 2.3.4 plugin with Maven

mthmulders
Hello Chris,

By issuing mvn help:effective-pom -Dverbose=true, you can inspect the
"effective POM". It will show you where the version of the Error Prone
is selected:

     <errorprone.version>2.3.3</errorprone.version>
     <!-- org.onosproject:onos-dependencies:2.2.7-b2, line 37 -->

(you may need to scroll a bit, it's pretty much near the top of the output)

The version of Error Prone is selected from the parent module,
org.onosproject:onos-dependencies:2.2.7-b2, line 37. Please see if you
can update that module to use the newer version of Error Prone, and then
use the never version of that module in your own project.

Hope this helps!

Maarten

On 18/11/2020 12:04, Chris Ward wrote:

> I am using Maven to build the ONOS 'trellis-t3' app. I get an unhandled
> exception from the Error Prone static analysis plugin (with version
> 2.3.3 of Error Prone). According to
> https://github.com/google/error-prone/issues/1940 
> <https://github.com/google/error-prone/issues/1940>this is fixed in
> version 2.3.4 of Error Prone.
>
> How do I cause Maven to use this newer version of Error Prone ?
>
> My build command is
> docker run -it --rm -v $HOME/.m2:/root/.m2 -v $PWD:/root/trellis-t3 -w
> /root/trellis-t3 maven:latest mvn clean install
> i.e. I'm running a Docker-packaged Maven.
>
> If anyone wants to reproduce the error, you will need to download
> 'trellis-t3' with
> git clone https://gerrit.onosproject.org/trellis-t3 
> <https://gerrit.onosproject.org/trellis-t3>
>
> *T J (Chris) Ward, IBM Research.
> Scalable Data-Centric Computing - IBM Spectrum MPI
> IBM United Kingdom Ltd., Hursley Park, Winchester, Hants, SO21 2JN
> 011-44-1962-818679
> LinkedIn **_https://www.linkedin.com/in/tjcward/_*
> <https://www.linkedin.com/in/tjcward/>*
> ResearchGate **_https://www.researchgate.net/profile/Thomas_Ward16_*
> <https://www.researchgate.net/profile/Thomas_Ward16>*
> **_
> _**_IBM Research -- Data Centric Systems_*
> <http://www.research.ibm.com/artificial-intelligence/hardware/>***_
> _**_IBM Supercomputer Marketing_*
> <https://www.ibm.com/it-infrastructure/power/scale-out>*
> **_
> _**_IBM Branded Products_* <https://www.ibm.com/products>***_IBM Branded
> Swag_* <https://logostore-globalid.us/>**
> <https://developer.ibm.com/articles/running-linux-and-ibm-spectrum-scale-on-ibm-supercomputers/>
>
>
> UNIX in the Cloud - Find A Place Where There's Room To Grow, with the
> original Open Standard. _Free Trial Here Today_
> <http://sdf.lonestar.org/index.cgi?telnet>
> Protein Folding by Supercomputer - _BlueMatter_
> <https://github.ibm.com/TJCW/BlueMatter>Molecular Dynamics package.
> Data Tables - _In-memory key-value store_
> <https://github.ibm.com/TJCW/tx-cics-tables>package.
> Linux on Windows - _Virtualisation_
> <https://w3-03.ibm.com/services/lighthouse/documents/124087>package. On
> the Lighthouse !
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to use error-prone 2.3.4 plugin with Maven

Chris Ward
In reply to this post by Chris Ward
I see
 <errorprone.version>2.3.3</errorprone.version>
in file ~/.m2/repository/org/onosproject/onos-dependencies/2.2.7-b2/onos-dependencies-2.2.7-b2.pom , but it's apparent that I'm not supposed to edit this file; it is owned by root, and there is what looks like a sha1 of the file in the same directory as if Maven is intending to detect changes.

So where is Maven getting this from into its cache ? That is, where do I find the original <errorprone.version>2.3.3</errorprone.version> so that I can change it to 2.3.4 ?

On 2020/11/18 11:39:05, Maarten Mulders <[hidden email]> wrote:
> Hello Chris,>
>
> By issuing mvn help:effective-pom -Dverbose=true, you can inspect the >
> "effective POM". It will show you where the version of the Error Prone >
> is selected:>
>
>      <errorprone.version>2.3.3</errorprone.version>>
>      <!-- org.onosproject:onos-dependencies:2.2.7-b2, line 37 -->>
>
> (you may need to scroll a bit, it's pretty much near the top of the output)>
>
> The version of Error Prone is selected from the parent module, >


T J (Chris) Ward, IBM Research.
Scalable Data-Centric Computing - IBM Spectrum MPI
IBM United Kingdom Ltd., Hursley Park, Winchester, Hants, SO21 2JN
011-44-1962-818679
LinkedIn
https://www.linkedin.com/in/tjcward/
ResearchGate
https://www.researchgate.net/profile/Thomas_Ward16

IBM Research -- Data Centric Systems
IBM Supercomputer Marketing

IBM Branded Products IBM Branded Swag

UNIX in the Cloud - Find A Place Where There's Room To Grow, with the original Open Standard. Free Trial Here Today
Protein Folding by Supercomputer - BlueMatter Molecular Dynamics package.
Data Tables - In-memory key-value store package.
Linux on Windows - Virtualisation package. On the Lighthouse !


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Reply | Threaded
Open this post in threaded view
|

Re: How to use error-prone 2.3.4 plugin with Maven

mthmulders
The reason that the file is owned by root is because you're running
Maven inside Docker. If you'd be running outside of Docker, you'd
probably run it under your own user, and the file would be owned by that
same user.

That said, indeed you should typically not need to edit files that live
in ~/.m2/repository. These files are downloaded from the Maven Central
repository and stored on your machine. They are uploaded to the Maven
Central repository by their maintainers.

The usual path would be to find out who maintains the Onos Project, and
ask them if they can a) upgrade the version of Error Prone and b) create
a new release. When that is done, you could update Trellis-T3 to use
that new release of the Onos Dependencies as its parent.

Hope this helps,

Maarten

On 18/11/2020 16:01, Chris Ward wrote:

> I see
>   <errorprone.version>2.3.3</errorprone.version>
> in file
> ~/.m2/repository/org/onosproject/onos-dependencies/2.2.7-b2/onos-dependencies-2.2.7-b2.pom
> , but it's apparent that I'm not supposed to edit this file; it is owned
> by root, and there is what looks like a sha1 of the file in the same
> directory as if Maven is intending to detect changes.
>
> So where is Maven getting this from into its cache ? That is, where do I
> find the original <errorprone.version>2.3.3</errorprone.version> so that
> I can change it to 2.3.4 ?
>
> On 2020/11/18 11:39:05, Maarten Mulders <[hidden email]> wrote:
>  > Hello Chris,>
>  >
>  > By issuing mvn help:effective-pom -Dverbose=true, you can inspect the >
>  > "effective POM". It will show you where the version of the Error Prone >
>  > is selected:>
>  >
>  >      <errorprone.version>2.3.3</errorprone.version>>
>  >      <!-- org.onosproject:onos-dependencies:2.2.7-b2, line 37 -->>
>  >
>  > (you may need to scroll a bit, it's pretty much near the top of the
> output)>
>  >
>  > The version of Error Prone is selected from the parent module, >
>
> *T J (Chris) Ward, IBM Research.
> Scalable Data-Centric Computing - IBM Spectrum MPI
> IBM United Kingdom Ltd., Hursley Park, Winchester, Hants, SO21 2JN
> 011-44-1962-818679
> LinkedIn **_https://www.linkedin.com/in/tjcward/_*
> <https://www.linkedin.com/in/tjcward/>*
> ResearchGate **_https://www.researchgate.net/profile/Thomas_Ward16_*
> <https://www.researchgate.net/profile/Thomas_Ward16>*
> **_
> _**_IBM Research -- Data Centric Systems_*
> <http://www.research.ibm.com/artificial-intelligence/hardware/>***_
> _**_IBM Supercomputer Marketing_*
> <https://www.ibm.com/it-infrastructure/power/scale-out>*
> **_
> _**_IBM Branded Products_* <https://www.ibm.com/products>***_IBM Branded
> Swag_* <https://logostore-globalid.us/>**
> <https://developer.ibm.com/articles/running-linux-and-ibm-spectrum-scale-on-ibm-supercomputers/>
>
>
> UNIX in the Cloud - Find A Place Where There's Room To Grow, with the
> original Open Standard. _Free Trial Here Today_
> <http://sdf.lonestar.org/index.cgi?telnet>
> Protein Folding by Supercomputer - _BlueMatter_
> <https://github.ibm.com/TJCW/BlueMatter>Molecular Dynamics package.
> Data Tables - _In-memory key-value store_
> <https://github.ibm.com/TJCW/tx-cics-tables>package.
> Linux on Windows - _Virtualisation_
> <https://w3-03.ibm.com/services/lighthouse/documents/124087>package. On
> the Lighthouse !
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to use error-prone 2.3.4 plugin with Maven

Jörg Schaible
In reply to this post by Chris Ward

Just overwrite that property from command line:


docker run -it --rm -v $HOME/.m2:/root/.m2 -v $PWD:/root/trellis-t3 -w

/root/trellis-t3 maven:latest mvn clean install -Derrorprone.version=2.3.4


BTW: That's one of the reasons to declare all versions with properties in POMs.


Am Mittwoch, 18. November 2020, 16:01:05 CET schrieb Chris Ward:

 

I see 

  <errorprone.version>2.3.3</errorprone.version> 

 in file ~/.m2/repository/org/onosproject/onos-dependencies/2.2.7-b2/onos-dependencies-2.2.7-b2.pom , but it's apparent that I'm not supposed to edit this file; it is owned by root, and there is what looks like a sha1 of the file in the same directory as if Maven is intending to detect changes. 

 

 So where is Maven getting this from into its cache ? That is, where do I find the original <errorprone.version>2.3.3</errorprone.version> so that I can change it to 2.3.4 ?

 

On 2020/11/18 11:39:05, Maarten Mulders <[hidden email]> wrote:


> Hello Chris,>
>
> By issuing mvn help:effective-pom -Dverbose=true, you can inspect the >
> "effective POM". It will show you where the version of the Error Prone >
> is selected:>
>
>      <errorprone.version>2.3.3</errorprone.version>>
>      <!-- org.onosproject:onos-dependencies:2.2.7-b2, line 37 -->>
>
> (you may need to scroll a bit, it's pretty much near the top of the output)>
>
> The version of Error Prone is selected from the parent module, >

T J (Chris) Ward, IBM Research.
Scalable Data-Centric Computing - IBM Spectrum MPI
IBM United Kingdom Ltd., Hursley Park, Winchester, Hants, SO21 2JN
011-44-1962-818679
LinkedIn https://www.linkedin.com/in/tjcward/ 
ResearchGate https://www.researchgate.net/profile/Thomas_Ward16 

 
IBM Research -- Data Centric Systems 
IBM Supercomputer Marketing 

 
IBM Branded Products IBM Branded Swag 


UNIX in the Cloud - Find A Place Where There's Room To Grow, with the original Open Standard. Free Trial Here Today 

Protein Folding by Supercomputer - BlueMatter Molecular Dynamics package.

Data Tables - In-memory key-value store package.

Linux on Windows - Virtualisation package. On the Lighthouse !



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


Reply | Threaded
Open this post in threaded view
|

Re: How to use error-prone 2.3.4 plugin with Maven

Chris Ward
In reply to this post by Chris Ward
Thanks ! Building with that version of 'docker run' with '-Derrorprone.version=2.3.4' succeeded.

On 2020/11/18 17:54:03, Jörg Schaible <[hidden email]> wrote:
> Just overwrite that property from command line:>
>
> docker run -it --rm -v $HOME/.m2:/root/.m2 -v $PWD:/root/trellis-t3 -w>
> /root/trellis-t3 maven:latest mvn clean install -Derrorprone.version=2.3.4>
>
> BTW: That's one of the reasons to declare all versions with properties in POMs.>
>
> Am Mittwoch, 18. November 2020, 16:01:05 CET schrieb Chris Ward:>
>
>
> I see>
>
>  <errorprone.version>2.3.3</errorprone.version>>
>
> in file ~/.m2/repository/org/onosproject/onos-depende


T J (Chris) Ward, IBM Research.
Scalable Data-Centric Computing - IBM Spectrum MPI
IBM United Kingdom Ltd., Hursley Park, Winchester, Hants, SO21 2JN
011-44-1962-818679
LinkedIn
https://www.linkedin.com/in/tjcward/
ResearchGate
https://www.researchgate.net/profile/Thomas_Ward16

IBM Research -- Data Centric Systems
IBM Supercomputer Marketing

IBM Branded Products IBM Branded Swag

UNIX in the Cloud - Find A Place Where There's Room To Grow, with the original Open Standard. Free Trial Here Today
Protein Folding by Supercomputer - BlueMatter Molecular Dynamics package.
Data Tables - In-memory key-value store package.
Linux on Windows - Virtualisation package. On the Lighthouse !


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU