﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-andyj2ee-随笔分类-maven</title><link>http://www.blogjava.net/andyj2ee/category/48765.html</link><description>java tec sky</description><language>zh-cn</language><lastBuildDate>Tue, 31 May 2011 06:19:19 GMT</lastBuildDate><pubDate>Tue, 31 May 2011 06:19:19 GMT</pubDate><ttl>60</ttl><item><title>Maven3 在Mac平台安裝</title><link>http://www.blogjava.net/andyj2ee/archive/2011/05/31/351430.html</link><dc:creator>java光环</dc:creator><author>java光环</author><pubDate>Tue, 31 May 2011 06:12:00 GMT</pubDate><guid>http://www.blogjava.net/andyj2ee/archive/2011/05/31/351430.html</guid><wfw:comment>http://www.blogjava.net/andyj2ee/comments/351430.html</wfw:comment><comments>http://www.blogjava.net/andyj2ee/archive/2011/05/31/351430.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/andyj2ee/comments/commentRss/351430.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/andyj2ee/services/trackbacks/351430.html</trackback:ping><description><![CDATA[&nbsp;<br /><div><span style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><h2>Maven在Mac平台安裝</h2></span></div><div><font class="Apple-style-span" face="arial, helvetica, clean, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">如果有安裝XCode, XCode會自動幫你安裝Maven, 安裝在/usr/share/java/</span></font><h3 style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">安裝3.0.3</h3><ol><li style="font-family: arial, helvetica, clean, sans-serif; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-weight: normal; font-size: 13px; color: #000000; text-decoration: none; ">到<a href="http://maven.apache.org/download.html" style="text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; color: #1111cc; ">http://maven.apache.org/download.html</a><img src="http://cb.esast.com/cb/images/out.png" alt="" style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " />下載maven 3.0.3</li><li style="font-family: arial, helvetica, clean, sans-serif; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-weight: normal; font-size: 13px; color: #000000; text-decoration: none; ">將apache-maven-3.0.3-bin.tar.gz解壓縮到/usr/share/java</li><li style="font-family: arial, helvetica, clean, sans-serif; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-weight: normal; font-size: 13px; color: #000000; text-decoration: none; ">移除/usr/share下的softlink maven</li><li style="font-family: arial, helvetica, clean, sans-serif; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-weight: normal; font-size: 13px; color: #000000; text-decoration: none; ">ln -s /usr/share/java/apache-maven-3.0.3 /usr/share/maven</li><li><font class="Apple-style-span" face="arial, helvetica, clean, sans-serif" size="2"><span class="Apple-style-span" style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">修改~/.profile 設定M3_HOME=/usr/share/java/apache-maven-3.0.3</span></font><br /><br /><div style="color: #000000; font-family: arial, helvetica, clean, sans-serif; font-size: 13px; font-weight: normal; line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; text-decoration: none; "><h4>注意事項</h4>不能同時設M2_HOME與M3_HOME兩個環境變數, 不然執行maven會出現以下的exception<pre style="font-family: monospace; font-size: 13px; overflow-x: auto; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; line-height: normal; margin-top: 1em; margin-right: 2em; margin-bottom: 1em; margin-left: 2em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f0f0f0; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; border-top-color: #3c78b5; border-right-color: #3c78b5; border-bottom-color: #3c78b5; border-left-color: #3c78b5; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; background-position: initial initial; background-repeat: initial initial; ">Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher  Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)   at java.security.AccessController.doPrivileged(Native Method)   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)</pre></div>参考：http://cb.esast.com/cb/wiki/22945<br /><br /><br /><br /><div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">Installing Maven 3 on OS X</span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br /></span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">1. Install Mac Ports</span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">2. Install Maven 3</span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br /></span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">Open a terminal and type the following:</span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><br /></span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">sudo port install maven3 maven_select</span></div><div><span style="line-height: 16px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">sudo maven_select maven3</span></div></div><br /></li></ol></div><img src ="http://www.blogjava.net/andyj2ee/aggbug/351430.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/andyj2ee/" target="_blank">java光环</a> 2011-05-31 14:12 <a href="http://www.blogjava.net/andyj2ee/archive/2011/05/31/351430.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>