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 [email protected] <
[email protected]> 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
>
>
>

Reply via email to