Maven: Usage

Maven, is actually a java project manager..

Installing maven in windows need to set system environment vars like JAVA_HOME and PATH..

And it is rather copy & paste than installment..

some useful commands:

mvn archetype:generate
# to give groupid, artifactid.. others remain default..
# groupid is the package name of the project, all source files 
# should put package groupid; in the first line.
# otherwise mvn will think the source file not belongs to the package..
# Before compiling, we need to modify pom.xml under project folder.
# cd into created project folder mvn compile mvn package mvn exec:java
-Dexec.mainClass="groupid.mainclassname" # pdftest.pt.App

when modifying pom.xml, dependencies should be properly put in it. All the dependencies can be found here.

POM stands for Project Object Model.

 

---original file above--- ----problems and solvings below----

1. somet maven repositories cannot be reached without a proxy(sslocal).

use the following setting:

mvn ..  -DsocksProxyHost=127.0.0.1 -DsocksProxyPort=1080

2. sometimes the maven repositories might be down, so fetching from these sites might be hopeless. To make things working, we have to change the url to a reachable url(mirror).

We can find the file refering to the url by searching string in ~/.m2/settings.xml or .pom files in repositories folder, and replace the url with the mirror url.

And to use sgs under .m2 folder makes life easy, but make sure all slashes'/' should be replaced with '\\\/'.

转载于:https://www.cnblogs.com/sansna/p/6582286.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值