A "?"/.m2 folder is created by Maven

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

A "?"/.m2 folder is created by Maven

Leira Hua
I use Nix under Debian. I installed clojure through nix-shell -p clojure.
clj successfully started the repl after downloaded some poms from maven.
Then I found there is a folder named ‘?’ created under my $HOME. The maven
cache .m2 is under this ‘?’ folder. I tried leiningen, it is the same.

I suppose it should be a Java related issue rather than Clojure. So I tried
to install Maven and try with mvn. A simple mvn archetype:generate created
a '?'/.m2 folder under the current folder. mvn clean -X|grep setting shows:

$ mvn clean -X|grep setting
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG] Reading global settings from
/nix/store/jyrx2vh4kg1dhbyil63bclpkfhbq6r2i-apache-maven-3.6.2/maven/conf/settings.xml
[DEBUG] Reading user settings from ?/.m2/settings.xml


Where is this ‘?’ folder from? Is it expected behavior? How do I get rid of
it?

Here is a screenshot showing the ‘?’ folder under  $HOME:
[image: Screenshot from 2019-12-04 18-40-35]
<https://user-images.githubusercontent.com/39118/70199367-54c8c180-16c6-11ea-9cc7-d3c64a4cf619.png>


Thanks,

- Leira
Reply | Threaded
Open this post in threaded view
|

Re: A "?"/.m2 folder is created by Maven

Jeff MAURY
What's the value of $HOME

Le sam. 14 déc. 2019 à 08:22, Leira Hua <[hidden email]> a écrit :

> I use Nix under Debian. I installed clojure through nix-shell -p clojure.
> clj successfully started the repl after downloaded some poms from maven.
> Then I found there is a folder named ‘?’ created under my $HOME. The maven
> cache .m2 is under this ‘?’ folder. I tried leiningen, it is the same.
>
> I suppose it should be a Java related issue rather than Clojure. So I tried
> to install Maven and try with mvn. A simple mvn archetype:generate created
> a '?'/.m2 folder under the current folder. mvn clean -X|grep setting shows:
>
> $ mvn clean -X|grep setting
> [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> [DEBUG] Reading global settings from
>
> /nix/store/jyrx2vh4kg1dhbyil63bclpkfhbq6r2i-apache-maven-3.6.2/maven/conf/settings.xml
> [DEBUG] Reading user settings from ?/.m2/settings.xml
>
>
> Where is this ‘?’ folder from? Is it expected behavior? How do I get rid of
> it?
>
> Here is a screenshot showing the ‘?’ folder under  $HOME:
> [image: Screenshot from 2019-12-04 18-40-35]
> <
> https://user-images.githubusercontent.com/39118/70199367-54c8c180-16c6-11ea-9cc7-d3c64a4cf619.png
> >
>
>
> Thanks,
>
> - Leira
>
Reply | Threaded
Open this post in threaded view
|

Re: A "?"/.m2 folder is created by Maven

Thomas Broyer-2
IIRC, Java's user.home system property does not depend on $HOME but on the
home of the current user as declared in /etc/passwd
If you want to set/change it, you need to set the system property with
-Duser.home=… (with Maven, you'd set it in $MAVEN_OPTS; I think you could
also use $_JAVA_OPTS to set it for each and every JVM)

Le sam. 14 déc. 2019 à 09:28, Jeff MAURY <[hidden email]> a écrit :

> What's the value of $HOME
>
> Le sam. 14 déc. 2019 à 08:22, Leira Hua <[hidden email]> a écrit :
>
> > I use Nix under Debian. I installed clojure through nix-shell -p clojure.
> > clj successfully started the repl after downloaded some poms from maven.
> > Then I found there is a folder named ‘?’ created under my $HOME. The
> maven
> > cache .m2 is under this ‘?’ folder. I tried leiningen, it is the same.
> >
> > I suppose it should be a Java related issue rather than Clojure. So I
> tried
> > to install Maven and try with mvn. A simple mvn archetype:generate
> created
> > a '?'/.m2 folder under the current folder. mvn clean -X|grep setting
> shows:
> >
> > $ mvn clean -X|grep setting
> > [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> > [DEBUG] Reading global settings from
> >
> >
> /nix/store/jyrx2vh4kg1dhbyil63bclpkfhbq6r2i-apache-maven-3.6.2/maven/conf/settings.xml
> > [DEBUG] Reading user settings from ?/.m2/settings.xml
> >
> >
> > Where is this ‘?’ folder from? Is it expected behavior? How do I get rid
> of
> > it?
> >
> > Here is a screenshot showing the ‘?’ folder under  $HOME:
> > [image: Screenshot from 2019-12-04 18-40-35]
> > <
> >
> https://user-images.githubusercontent.com/39118/70199367-54c8c180-16c6-11ea-9cc7-d3c64a4cf619.png
> > >
> >
> >
> > Thanks,
> >
> > - Leira
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: A "?"/.m2 folder is created by Maven

michaelo
In reply to this post by Leira Hua
Am 2019-12-12 um 02:23 schrieb Leira Hua:

> I use Nix under Debian. I installed clojure through nix-shell -p clojure.
> clj successfully started the repl after downloaded some poms from maven.
> Then I found there is a folder named ‘?’ created under my $HOME. The maven
> cache .m2 is under this ‘?’ folder. I tried leiningen, it is the same.
>
> I suppose it should be a Java related issue rather than Clojure. So I tried
> to install Maven and try with mvn. A simple mvn archetype:generate created
> a '?'/.m2 folder under the current folder. mvn clean -X|grep setting shows:
>
> $ mvn clean -X|grep setting
> [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> [DEBUG] Reading global settings from
> /nix/store/jyrx2vh4kg1dhbyil63bclpkfhbq6r2i-apache-maven-3.6.2/maven/conf/settings.xml
> [DEBUG] Reading user settings from ?/.m2/settings.xml
>
>
> Where is this ‘?’ folder from? Is it expected behavior? How do I get rid of
> it?

Delete ~/.m2 and start the Java process with strace, upload that file.
We will see direct system calls.

Michael


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

Reply | Threaded
Open this post in threaded view
|

Re: A "?"/.m2 folder is created by Maven

Leira Hua
Sorry for the late reply.

The Java process in question is clj, which is the Clojure command line. I
only reproduced this issue in a Nix environment within a gLInux
distribution (A Debian based distro). I tried to run clj in NixOS, it
created $HOME/.m2 as expected, rather than $HOME/?/.m2 as in Nix in gLinux.

The steps I used to reproduce the issue are:

   1. Setup Nix environment in gLinux: curl https://nixos.org/nix/install |
   sh
   2. Start a nix shell with Clojure package:nix-shell -p clojure
   3. Run clj with strace: strace clj -e '(println "Hello!")' >
   /tmp/clj.strace 2>&1

After running clj, a $HOME/?/.m2 is created:

'/usr/local/google/home/leirahua/?/.m2'

I attached the strace here
<https://gist.github.com/leira/95a802cfb82431c7f7ee74f2bada8cc1>

Thanks,
Leira

On Sat, Dec 14, 2019 at 2:11 AM Michael Osipov <[hidden email]> wrote:

> Am 2019-12-12 um 02:23 schrieb Leira Hua:
> > I use Nix under Debian. I installed clojure through nix-shell -p clojure.
> > clj successfully started the repl after downloaded some poms from maven.
> > Then I found there is a folder named ‘?’ created under my $HOME. The
> maven
> > cache .m2 is under this ‘?’ folder. I tried leiningen, it is the same.
> >
> > I suppose it should be a Java related issue rather than Clojure. So I
> tried
> > to install Maven and try with mvn. A simple mvn archetype:generate
> created
> > a '?'/.m2 folder under the current folder. mvn clean -X|grep setting
> shows:
> >
> > $ mvn clean -X|grep setting
> > [DEBUG]   Imported: org.apache.maven.settings < plexus.core
> > [DEBUG] Reading global settings from
> >
> /nix/store/jyrx2vh4kg1dhbyil63bclpkfhbq6r2i-apache-maven-3.6.2/maven/conf/settings.xml
> > [DEBUG] Reading user settings from ?/.m2/settings.xml
> >
> >
> > Where is this ‘?’ folder from? Is it expected behavior? How do I get rid
> of
> > it?
>
> Delete ~/.m2 and start the Java process with strace, upload that file.
> We will see direct system calls.
>
> Michael
>
>