maven使用笔记

1、maven引用第三方jar

①,下载jar包,使用以下命令将下载的包安装至本地仓库中:

mvn install:install-file -DgroupId=net.sf.ehcache -DartifactId=ehcache -Dversion=2.9.0 -Dpackaging=jar -Dfile=D:/repository/ehcache-2.9.0.jar -DgeneratePom=true

②,下载jar包,直接引用:

        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>2.9.0</version>
            <scope>system</scope>
            <systemPath>D:/repository/ehcache-2.9.0.jar</systemPath>
        </dependency>

以上方式都只能本地使用,如果多人开发的环境,还是需要上传到公共的仓库中

2、常用命令

①,跳过单元测试:

mvn clean install -Dmaven.test.skip=true

或者在pom.xml加入:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>

或者:

<properties>
    <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
    <maven.test.skip>true</maven.test.skip>
</properties>


转载于:https://my.oschina.net/wnjustdoit/blog/357683

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值