Skip to main content
Question

Maven and User folder Bash_profile

  • June 2, 2017
  • 1 reply
  • 56 views

Forum|alt.badge.img+3

Good Morning All

I am wanting to deploy maven to group of machines and set the following

~/.bash_profile
export M2_HOME=/Users/Shared/apache-maven-3.5.0
export PATH=$PATH:$M2_HOME/bin

is this possible to set under the users path I.e /Users/Staff.Name/.bash_profile

I have had a go at copying this file with the maven package and then running an after script to move it to ~/, but I suspect this always runs as root and then moves this to root ~/ not the logged in user ~/

1 reply

Forum|alt.badge.img+7
  • Contributor
  • June 5, 2017

If the intent is to add this for all users, you could just add it to /etc/bashrc.

Throw this into your postinstall script:

echo $'export M2_HOME=/Users/Shared/apache-maven-3.5.0
export PATH=$PATH:$M2_HOME/bin' >> /etc/bashrc