maven 常用命令

来源:互联网 发布:淘宝店铺违规了怎么办 编辑:程序博客网 时间:2024/06/06 08:49

一、将maven 依赖复制到指定目录

mvn dependency:copy-dependencies -DoutputDirectory=lib   -DincludeScope=compile


二、Maven 手动添加 JAR 包到本地仓库

 Maven 常用仓库网址:

http://mvnrepository.com/
http://search.maven.org/
http://repository.sonatype.org/content/groups/public/
http://people.apache.org/repo/m2-snapshot-repository/
http://people.apache.org/repo/m2-incubating-repository/

Maven 安装 JAR 包的命令是:
mvn install:install-file -Dfile=jar包的位置 -DgroupId=上面的groupId -DartifactId=上面的artifactId -Dversion=上面的version -Dpackaging=jar

示例

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>
mvn install:install-file -Dfile=D:\mvn\spring-context-support-3.1.0.RELEASE.jar -DgroupId=org.springframework -DartifactId=spring-context-support -Dversion=3.1.0.RELEASE -Dpackaging=jar

三、maven 打包跳过测试
page -Dmaven.test.skip=true //不执行测试用例,也不编译测试用例类 
-DskipTests   //不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下

0 0
原创粉丝点击