You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Leira Hua <le...@gmail.com> on 2019/12/12 01:23:56 UTC

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

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

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

Posted by Leira Hua <le...@gmail.com>.
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 <mi...@apache.org> 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
>
>

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

Posted by Michael Osipov <mi...@apache.org>.
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


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

Posted by Thomas Broyer <t....@gmail.com>.
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 <je...@jeffmaury.com> a écrit :

> What's the value of $HOME
>
> Le sam. 14 déc. 2019 à 08:22, Leira Hua <le...@gmail.com> 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
> >
>

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

Posted by Jeff MAURY <je...@jeffmaury.com>.
What's the value of $HOME

Le sam. 14 déc. 2019 à 08:22, Leira Hua <le...@gmail.com> 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
>