You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Christopher.Miller@gd-ms.com" <Ch...@gd-ms.com> on 2021/08/18 15:44:12 UTC

Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users


Hi, this is on RHEL8, trying to standardized on how we install Maven where I work, so it's the same for each user.  Make it easy for setup and troubleshoot.

From a RHEL8 workstation, I'm running the following command, as we have a repository to pull from:


dnf install maven -y


DNF pulls in all dependencies and installs successfully (we are sticking with Red Hat packages as to keep things as simple as possible), as I can confirm this with the following:


[user_a@rhel8-maven3 bin]$ mvn --version
Apache Maven 3.5.4 (Red Hat 3.5.4-5)
Maven home: /usr/share/maven
Java version: 1.8.0_282, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-4.el8.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-305.el8.x86_64", arch: "amd64", family: "unix"
[user_a@rhel8-maven3 bin]$


However it didn't create a .m2 directory for any of the users.  Will this have to be created manually?  Along with creating the settings.xml file?  I didn't see anything in the documentation on how to create .m2.

Our end goal is to create an Ansible Playbook to automate this install as well and want to have the correct steps.

Thanks



Re: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users

Posted by Greg Chabala <gr...@gmail.com>.
The .m2 directory will be created automatically on first use, as I recall.
A non-trivial command that pulls some artifacts should be enough. You would
only be concerned with creating it yourself if you need to set up specific
values in settings.xml, which is your responsibility to create if needed.

The bigger concern is that your Red Hat package is so old.
https://maven.apache.org/docs/history.html The first time you have an issue
that requires technical help, people will ask you to try the current
version.

If you're going through the effort of making an Ansible Playbook, you might
as well install the current version from a tarball.

Also, as Maven falls under the umbrella of 'developer tools', one would
usually encourage developers to install their own tooling as needed. I
would be displeased if my workplace wanted to standardize on a three year
old version of Maven and script its installation for me.

On Wed, Aug 18, 2021 at 10:44 AM Christopher.Miller@gd-ms.com <
Christopher.Miller@gd-ms.com> wrote:

>
>
> Hi, this is on RHEL8, trying to standardized on how we install Maven where
> I work, so it's the same for each user.  Make it easy for setup and
> troubleshoot.
>
> From a RHEL8 workstation, I'm running the following command, as we have a
> repository to pull from:
>
>
> dnf install maven -y
>
>
> DNF pulls in all dependencies and installs successfully (we are sticking
> with Red Hat packages as to keep things as simple as possible), as I can
> confirm this with the following:
>
>
> [user_a@rhel8-maven3 bin]$ mvn --version
> Apache Maven 3.5.4 (Red Hat 3.5.4-5)
> Maven home: /usr/share/maven
> Java version: 1.8.0_282, vendor: Red Hat, Inc., runtime:
> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-4.el8.x86_64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "4.18.0-305.el8.x86_64", arch: "amd64", family:
> "unix"
> [user_a@rhel8-maven3 bin]$
>
>
> However it didn't create a .m2 directory for any of the users.  Will this
> have to be created manually?  Along with creating the settings.xml file?  I
> didn't see anything in the documentation on how to create .m2.
>
> Our end goal is to create an Ansible Playbook to automate this install as
> well and want to have the correct steps.
>
> Thanks
>
>
>

Re: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
If you want to deploy a pre-configured ~/.m2/settings.xml you can do that perfectly fine with ansible, just configure it to generate missing parent directories. It is normal that dot files/dirs in user directory are created only on first use. This is not specific to RedHat, and there is also nothing special to the directory, just create it as needed and make sure it has the correct owner and permission.

We have good experiences with doing that in a developer workplace provisioning, but as mention by others we would not force ancient versions upon developers.

BTW you really need a internal repository Server anyway, if you have that you can also use it to download the actual maven archive for installation.

Gruss
Bernd

--
http://bernd.eckenfels.net
________________________________
Von: Christopher.Miller@gd-ms.com <Ch...@gd-ms.com>
Gesendet: Thursday, August 19, 2021 6:43:34 PM
An: Maven Users List <us...@maven.apache.org>
Betreff: RE: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users



Thanks for the reply.

I've worked with different version of RHEL for sometimes now and its my understanding that Red Hat packages older versions of software because they know it "should" work out of the box.

Forgot to mention, this is a air-gapped environment, so its hard to get things in and out of it, so going with the Maven release from Red Hat maybe our only option, but I want to test a tarball in a virtualized environment, see how that works too.



-----Original Message-----
From: Michael Osipov <mi...@apache.org>
Sent: Wednesday, August 18, 2021 2:15 PM
To: users@maven.apache.org
Subject: Re: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users

----
External E-mail --- CAUTION: This email originated from outside GDMS. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Please note that:

Am 2021-08-18 um 17:44 schrieb Christopher.Miller@gd-ms.com:
> [user_a@rhel8-maven3 bin]$ mvn --version Apache Maven 3.5.4 (Red Hat
> 3.5.4-5)
                       ^^^^^^^^^^^^^^^
Custom distributions are discouraged and not supported by us.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users

Posted by "Christopher.Miller@gd-ms.com" <Ch...@gd-ms.com>.

Thanks for the reply. 

I've worked with different version of RHEL for sometimes now and its my understanding that Red Hat packages older versions of software because they know it "should" work out of the box. 

Forgot to mention, this is a air-gapped environment, so its hard to get things in and out of it, so going with the Maven release from Red Hat maybe our only option, but I want to test a tarball in a virtualized environment, see how that works too. 



-----Original Message-----
From: Michael Osipov <mi...@apache.org> 
Sent: Wednesday, August 18, 2021 2:15 PM
To: users@maven.apache.org
Subject: Re: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users

----
External E-mail --- CAUTION: This email originated from outside GDMS. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Please note that:

Am 2021-08-18 um 17:44 schrieb Christopher.Miller@gd-ms.com:
> [user_a@rhel8-maven3 bin]$ mvn --version Apache Maven 3.5.4 (Red Hat 
> 3.5.4-5)
                       ^^^^^^^^^^^^^^^
Custom distributions are discouraged and not supported by us.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Question on installing Maven from Red Hat (RHEL8), missing .m2 directory for users

Posted by Michael Osipov <mi...@apache.org>.
Please note that:

Am 2021-08-18 um 17:44 schrieb Christopher.Miller@gd-ms.com:
> [user_a@rhel8-maven3 bin]$ mvn --version
> Apache Maven 3.5.4 (Red Hat 3.5.4-5)
                       ^^^^^^^^^^^^^^^
Custom distributions are discouraged and not supported by us.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org