[/code][b]APPfuse2.0 mvn appfuse:full-source[/b]
1:maven的环境搭建
配置maven的环境变量 MAVEN_HOME = d:/maven(例如你的maven下载到d盘根目录)
2:下载appfuse 提供好的 repository[url]https://appfuse.dev.java.net/files/documents/1397/77087/appfuse-dependencies-2.0.1-with-source-and-javadoc.zip
[/url]
3: 修改maven的配置
修改原因:默认情况下 repository 在 C:\Documents and Settings\Administrator\.m2\repository ,因为这个路径中包含一个空格,所以在后续使用 mvn appfuse:full-source 命令的时候会产生异常;
[code="java"]
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'appfuse'.
[INFO] ------------------------------------------------------------------------
[INFO] Building AppFuse Modular Application - Core
[INFO] task-segment: [appfuse:full-source]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
Illegal character in path at index 18: file:/C:/Documents and Settings/Administrator/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalArgumentException
at java.net.URI.create(URI.java:842)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
at org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
at org.apache.tools.ant.Project.setAntLib(Project.java:313)
at org.apache.tools.ant.Project.initProperties(Project.java:309)
at org.apache.tools.ant.Project.init(Project.java:295)
修改方法:官方解决地址http://www.nabble.com/Re%3A-problem-with-appfuse%3Agen-in-windows-p13974654s2369.html
意思是讲是ant的bug,里面不能有空格,因为Documents and Settings里面有空格所以报错。
我就直接把repository文件夹拷贝到了,我的appfuse文件下面,例如:E:\appfuse\repository
在E:\Tools\maven\apache-maven-2.0.8\conf的settings.xml修改如下:
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ~/.m2/repository
<localRepository>/path/to/local/repo</localRepository>
-->
<localRepository>D:\appfuse\repository</localRepository>
把第二步下载好的zip文件解压到D:\appfuse\repository目录中(本部操作 适合offline)