mg>diag advice below

________________________________
From: Dan Pungă <[email protected]>
Sent: Monday, February 19, 2018 4:00 PM
To: [email protected]
Subject: maven creates a ? directory instead of .m2 repository

Hello all!

I'm trying to get a Java app deployed in an OpenShift container and I'm
experiencing a strange behaviour.

At build time (firs build), maven is creating a ? directory inside the
context from which it's called (so in my project's root folder) to
create the repository directory and download the build time
dependencies. I'd really want to know why it does that, and make it use
the .m2 location from the home folder. I have a feeling it has to do
with some sort of fishy user permission, but I'm not sure if it's
actually the case or where am I doing wrong.

That's the short description of the problem. My working system is like this:
- on a OpenShift/docker virtual machine running centos 7
- I've installed maven version 3.3.9 from
https://www.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
- I've setup a $HOME directory which contains a .m2 directory that
contains my settings.xml to make maven use a local/cached repository
- this was done under root, but I've recursively changed ownership and
permission to the common user 1001 for what's related to maven

mg>did you follow the steps for useradd here?
https://www.ehowstuff.com/how-to-add-user-to-root-group-on-centos-5-7/
How to Add User to root Group on CentOS 5/CentOS 
6<https://www.ehowstuff.com/how-to-add-user-to-root-group-on-centos-5-7/>
www.ehowstuff.com
useradd is a low-level utility to create new users to the system. When used 
without the -D option, useradd command will create a new user account using the 
command ...

mg>what happens when you look at user groups..do you see new user (whatever 
name you used)
mg>grep PossibleIncorrectlyInterpretedUserNameInRootGroup /etc/group


- my sources come on this system with a bit if an awkward set of
permissions so that the owner is user (1001), but the group is root

When I run maven with just the targets used for the project, it doesn't
read from the settings.xml, but instead tries to connect to the global
repository.

mg> -o option tells maven to run offline

When running maven with the "-s $HOME/.m2/settings.xml" option, it does
take it into consideration and the build works fine, but it is
downloadying all the repository artifacts into ?/repository folder under
the local dir (app folder, the one which holds the pom.xml file).

Any idea what would be the reason for this behaviour?

Thank you in advance!

Reply via email to