Re: Need Help with Maven Build

2020-05-21 Thread Jun Wang
Got it, thanks for the recommended reading.


From: Christopher 
Sent: Thursday, May 21, 2020 10:00 AM
To: d...@zookeeper.apache.org 
Cc: UserZooKeeper 
Subject: Re: Need Help with Maven Build

On Wed, May 20, 2020 at 9:58 AM Szalay-Bekő Máté
 wrote:
>
> I saw this problem a few times (usually when I build from IntelliJ console,
> after I changed to a different git branch).
>
> My solution is usually:
> git clean -xdf
> git reset --hard
> mvn clean
>
> after these steps usually "mvn clean install -DskipTests" works just fine

One variation of this recommendation I would make is: avoid using
`install`, because it can have unintended consequences. Only use
`install` when you explicitly need your built artifacts to be
installed into your local Maven repository for use in other local
builds. All other times, use `verify` instead, which should do
everything `install` does, but without polluting your local maven
repository with local builds (which can cause unexpected problems in
some cases, and that can be confusing to novice Maven users). For more
on the Maven targets in the default build lifecycle, I strongly
recommend reading this guide:
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html


Re: Need Help with Maven Build

2020-05-21 Thread Christopher
On Wed, May 20, 2020 at 9:58 AM Szalay-Bekő Máté
 wrote:
>
> I saw this problem a few times (usually when I build from IntelliJ console,
> after I changed to a different git branch).
>
> My solution is usually:
> git clean -xdf
> git reset --hard
> mvn clean
>
> after these steps usually "mvn clean install -DskipTests" works just fine

One variation of this recommendation I would make is: avoid using
`install`, because it can have unintended consequences. Only use
`install` when you explicitly need your built artifacts to be
installed into your local Maven repository for use in other local
builds. All other times, use `verify` instead, which should do
everything `install` does, but without polluting your local maven
repository with local builds (which can cause unexpected problems in
some cases, and that can be confusing to novice Maven users). For more
on the Maven targets in the default build lifecycle, I strongly
recommend reading this guide:
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html


Re: Need Help with Maven Build

2020-05-20 Thread Jun Wang
Thanks for your solution, it is working now.


From: Szalay-Bekő Máté 
Sent: Wednesday, May 20, 2020 9:58 AM
To: UserZooKeeper 
Cc: d...@zookeeper.apache.org 
Subject: Re: Need Help with Maven Build

I saw this problem a few times (usually when I build from IntelliJ console,
after I changed to a different git branch).

My solution is usually:
git clean -xdf
git reset --hard
mvn clean

after these steps usually "mvn clean install -DskipTests" works just fine

On Wed, May 20, 2020 at 1:27 PM Jun Wang  wrote:

> I am using latest maven, build failed with zookeeper source code checked
> out from github. but build is fine with downloaded source code
> apache-zookeeper-3.6.1.tar.gz
>
> $ mvn --version
> Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: /home/jun/programs/apache-maven-3.6.3
> Java version: 1.8.0_251, vendor: Oracle Corporation, runtime:
> /home/jun/programs/jdk1.8.0_251/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "4.10.0-38-generic", arch: "amd64", family:
> "unix"
>
>
> 
> From: Michael Han 
> Sent: Wednesday, May 20, 2020 1:08 AM
> To: user 
> Cc: d...@zookeeper.apache.org 
> Subject: Re: Need Help with Maven Build
>
> hi jun - which maven version you are using?
>
> If it's 3.5.x, try upgrade to 3.6.x. I had the exact same issue a while
> back and upgrade maven fixed this, so I didn't bother to debug. That said,
> it's interesting to understand why we failed under specific version of
> maven / env, so cc dev list where we have a few maven experts who might be
> able to help debug.
>
>
> On Tue, May 19, 2020 at 8:34 AM Jun Wang  wrote:
>
> > Hi
> >
> > I got following build error with latest code from github.  But build is
> > fine with downloaded source code.   Any suggestion is appreciated.
> >
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile
> > (default-compile) on project zookeeper: Fatal error compiling:
> > java.lang.NullPointerException -> [Help 1]
> >
> >
> >
> https://gist.githubusercontent.com/wj1918/b1bcea0473b9ff2096ffa22e3c387e8f/raw/8c2ccfb7919470e0e874abdec5633976720e3dca/zookeeper.build.error.txt
> >
> > Thanks
> > Jun
>


Re: Need Help with Maven Build

2020-05-20 Thread Szalay-Bekő Máté
I saw this problem a few times (usually when I build from IntelliJ console,
after I changed to a different git branch).

My solution is usually:
git clean -xdf
git reset --hard
mvn clean

after these steps usually "mvn clean install -DskipTests" works just fine

On Wed, May 20, 2020 at 1:27 PM Jun Wang  wrote:

> I am using latest maven, build failed with zookeeper source code checked
> out from github. but build is fine with downloaded source code
> apache-zookeeper-3.6.1.tar.gz
>
> $ mvn --version
> Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: /home/jun/programs/apache-maven-3.6.3
> Java version: 1.8.0_251, vendor: Oracle Corporation, runtime:
> /home/jun/programs/jdk1.8.0_251/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "4.10.0-38-generic", arch: "amd64", family:
> "unix"
>
>
> 
> From: Michael Han 
> Sent: Wednesday, May 20, 2020 1:08 AM
> To: user 
> Cc: d...@zookeeper.apache.org 
> Subject: Re: Need Help with Maven Build
>
> hi jun - which maven version you are using?
>
> If it's 3.5.x, try upgrade to 3.6.x. I had the exact same issue a while
> back and upgrade maven fixed this, so I didn't bother to debug. That said,
> it's interesting to understand why we failed under specific version of
> maven / env, so cc dev list where we have a few maven experts who might be
> able to help debug.
>
>
> On Tue, May 19, 2020 at 8:34 AM Jun Wang  wrote:
>
> > Hi
> >
> > I got following build error with latest code from github.  But build is
> > fine with downloaded source code.   Any suggestion is appreciated.
> >
> > [ERROR] Failed to execute goal
> > org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile
> > (default-compile) on project zookeeper: Fatal error compiling:
> > java.lang.NullPointerException -> [Help 1]
> >
> >
> >
> https://gist.githubusercontent.com/wj1918/b1bcea0473b9ff2096ffa22e3c387e8f/raw/8c2ccfb7919470e0e874abdec5633976720e3dca/zookeeper.build.error.txt
> >
> > Thanks
> > Jun
>


Re: Need Help with Maven Build

2020-05-20 Thread Jun Wang
I am using latest maven, build failed with zookeeper source code checked out 
from github. but build is fine with downloaded source code 
apache-zookeeper-3.6.1.tar.gz

$ mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/jun/programs/apache-maven-3.6.3
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: 
/home/jun/programs/jdk1.8.0_251/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-38-generic", arch: "amd64", family: "unix"



From: Michael Han 
Sent: Wednesday, May 20, 2020 1:08 AM
To: user 
Cc: d...@zookeeper.apache.org 
Subject: Re: Need Help with Maven Build

hi jun - which maven version you are using?

If it's 3.5.x, try upgrade to 3.6.x. I had the exact same issue a while
back and upgrade maven fixed this, so I didn't bother to debug. That said,
it's interesting to understand why we failed under specific version of
maven / env, so cc dev list where we have a few maven experts who might be
able to help debug.


On Tue, May 19, 2020 at 8:34 AM Jun Wang  wrote:

> Hi
>
> I got following build error with latest code from github.  But build is
> fine with downloaded source code.   Any suggestion is appreciated.
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile
> (default-compile) on project zookeeper: Fatal error compiling:
> java.lang.NullPointerException -> [Help 1]
>
>
> https://gist.githubusercontent.com/wj1918/b1bcea0473b9ff2096ffa22e3c387e8f/raw/8c2ccfb7919470e0e874abdec5633976720e3dca/zookeeper.build.error.txt
>
> Thanks
> Jun


Re: Need Help with Maven Build

2020-05-19 Thread Michael Han
hi jun - which maven version you are using?

If it's 3.5.x, try upgrade to 3.6.x. I had the exact same issue a while
back and upgrade maven fixed this, so I didn't bother to debug. That said,
it's interesting to understand why we failed under specific version of
maven / env, so cc dev list where we have a few maven experts who might be
able to help debug.


On Tue, May 19, 2020 at 8:34 AM Jun Wang  wrote:

> Hi
>
> I got following build error with latest code from github.  But build is
> fine with downloaded source code.   Any suggestion is appreciated.
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile
> (default-compile) on project zookeeper: Fatal error compiling:
> java.lang.NullPointerException -> [Help 1]
>
>
> https://gist.githubusercontent.com/wj1918/b1bcea0473b9ff2096ffa22e3c387e8f/raw/8c2ccfb7919470e0e874abdec5633976720e3dca/zookeeper.build.error.txt
>
> Thanks
> Jun


Need Help with Maven Build

2020-05-19 Thread Jun Wang
Hi

I got following build error with latest code from github.  But build is fine 
with downloaded source code.   Any suggestion is appreciated.

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) 
on project zookeeper: Fatal error compiling: java.lang.NullPointerException -> 
[Help 1]

https://gist.githubusercontent.com/wj1918/b1bcea0473b9ff2096ffa22e3c387e8f/raw/8c2ccfb7919470e0e874abdec5633976720e3dca/zookeeper.build.error.txt

Thanks
Jun