Archive for category maven
Some Helpful Settings For Maven Builds
Posted by admin in actionscript, air, eclipse, flash builder, flex, flex builder, maven on December 20th, 2010
When running Maven builds, there are typically a few settings that are useful to have in your ~/.bash_profile (for Mac or similar, depending on your shell) to help get things off on the right foot.
Set memory usage to 1024M minimum.
export MAVEN_OPTS=-Xmx1024m
Set the path to the appropriate SDK for Flash Builder
FLASH4_SDK=’/Applications/Adobe Flash Builder 4 Plug-in/sdks/3.5.0′
Set the path for ADL if building AIR applications
ADL_PATH=${FLASH4_SDK}/bin
Set the path to the Flash Player for launching FlexUnit tests
FLASH_PLAYER_PATH=’/Applications/Adobe Flash Builder 4 Plug-in/Player/mac/Flash Player.app/Contents/MacOS’
Append these to the current path
export PATH=${PATH}:${ADL_PATH}
export PATH=${PATH}:${FLASH_PLAYER_PATH}
Set MAVEN_OPTS For All Terminal Sessions
I was just exporting the MAVEN_OPTS var before I ran any maven command, but then I decided to just stick it in my terminal session’s profile (thanks to quick tip from my buddy Jon Marston) — you can do this 2 ways on your mac:
1) Open Profile in Finder
- Open Finder
- Locate and open the file /etc/profile — that’s in your root hard drive, in the folder etc.
- At the end of the file, drop in the following line:
export MAVEN_OPTS=-Xmx1024m
2) Open Terminal and Edit the Profile
- Open Terminal
- Enter in the following command:
sudo nano /etc/profile
This basically says that as a super user I want to edit the profile file in a poor man’s vi-like text editor — good phrase Marston.
- You’ll be asked for the super user’s password — if it’s your box then you know this — enter it and it’ll open profile.
- At the end of the file, drop in the following line:
export MAVEN_OPTS=-Xmx1024m
- Hit CTRL + X to exit
- It’ll ask if you want to save, so hit Y.
DONE.
Maven2 Install Error: java.lang.OutOfMemoryError: Java heap space
If you ever run the maven command “maven install” and you run into the following error:
[INFO] ------------------------------------------------------------------------ [ERROR] FATAL ERROR [INFO] ------------------------------------------------------------------------ [INFO] Java heap space [INFO] ------------------------------------------------------------------------ [INFO] Trace java.lang.OutOfMemoryError: Java heap space
Try setting the MAVEN_OPTS memory to a larger max; eg:
Last login: Wed Jul 1 12:33:56 on ttys000 brian-rileys-macbook-pro:~ brianmriley$ export MAVEN_OPTS=-Xmx1024m brian-rileys-macbook-pro:~ brianmriley$ cd /Users/brianmriley/projects/spring-hibernate/workspaces/emp-mgmt-console/SpringActionscript/trunk/core brian-rileys-macbook-pro:core brianmriley$ mvn install [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Spring ActionScript [INFO] task-segment: [install] [INFO] ------------------------------------------------------------------------ ... [INFO] Installing /Users/brianmriley/projects/spring-hibernate/workspaces/emp-mgmt-console/SpringActionscript/trunk/core/target/spring-actionscript-0.8-SNAPSHOT.swc to /Users/brianmriley/.m2/repository/org/springextensions/spring-actionscript/0.8-SNAPSHOT/spring-actionscript-0.8-SNAPSHOT.swc [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 33 seconds [INFO] Finished at: Wed Jul 01 14:58:34 EDT 2009 [INFO] Final Memory: 26M/115M [INFO] ------------------------------------------------------------------------
Just keep in mind this is a one time dealio and you’ll have to set this each time you run a maven install.