使用mvn archetype:generate我们可以设置路径但是手动设置怎么可能以及使用archetype的原理是什么:generate?
答案 0 :(得分:0)
Apache Maven下载并安装java
首先阅读文档(https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html)
https://maven.apache.org/download.cgi?Preferred=ftp://mirror.reverse.net/pub/apache/ 在某个位置解压缩
设置路径
go to Control Panel\All Control Panel Items\System
go to advanced system settings->environment variables
in system variables->add to path
C:\Program Files\Java\jdk1.7.0_04\bin;D:\apache-maven-3.0.4\bin
SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
(in place of red fields change accordingly)
安装并检查
go to D:\apache-maven-3.0.4\bin
type mvn
then type mvn archetype:generate
之前,如果您落后于代理,请按照*
中的步骤操作now press enter to choose default option when asked choose a number or apply...
press enter again till asked groupId
give groupId:com.mongodb
artifactId:Nil1234
press enter several times till asked :Y::
type Y and press enter
应显示BUILD Success
现在取消注释代理... / proxy的代码,方法是剪切它并在之后粘贴它 现在根据您的代理设置进行更改 在我的情况下,它看起来像以下
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>authproxy.serc.iisc.ernet.in</host>
<port>3128</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
-->
</proxies>
现在尝试运行mvn archetype:generate,它应该运行并下载