saltstack-formulas / maven-formula

A minimalistic way to install just the maven distribution without any dependencies
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
4 stars 10 forks source link

Darwin OS skips /etc/profile.d/apache-tomcat.sh profile #28

Closed noelmcloughlin closed 5 years ago

noelmcloughlin commented 5 years ago

The mvn command cannot be found on Darwin because OS is skipping the /etc/profile.d/apache-tomcat.sh profile.

$ ls -l /etc/profile.d/apache-maven.sh 
-rwxr-xr-x  1 root  admin  80 21 Mar 13:35 /etc/profile.d/apache-maven.sh

$ cat /etc/profile.d/apache-maven.sh 
export M2_HOME=/usr/local/lib/apache-maven-3.3.9
export PATH=$M2_HOME/bin:$PATH

$ mvn
-bash: mvn: command not found

$ source /etc/profile.d/apache-maven.sh 
$ mvn
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.059 s
[INFO] Finished at: 2019-03-21T13:43:16+00:00
[INFO] Final Memory: 7M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoGoalSpecifiedException
noelmcloughlin commented 5 years ago

Formula should create /etc/profile.d to avoid "Parent directory not present" Error.

This works on MacOS too (https://stackoverflow.com/questions/45383191/using-environment-variables-when-adding-paths-on-macos)

noelmcloughlin commented 5 years ago

Neither /etc/profile.d or /etc/paths.d work on MacOS.