• mvn使用记录


    1. mvn dependency:copy-dependencies  

    会导出到targed/dependency 下面

    2. mvn dependency:copy-dependencies -DoutputDirectory=lib

    这样jar包都会copy到工程目录下的lib里面

    3. 设置依赖级别,通常用编译需要的jar

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

    4. mvn -DskipTests clean package // test 可编译,仅跳过测试

    5. mvn -Dmaven.test.skip=true clean package  // test 不编译,也跳过测试

    ​6. 配置全部跳过

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

     7. 引入本地包:

    <dependency>
    <groupId>com.*.*</groupId>
    <artifactId>tinder</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/lib/tinder.jar</systemPath>
    </dependency>

    8. 资源过滤

    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    </resource>
    <resource>
    <directory>src/test/resources</directory>
    <filtering>true</filtering>
    </resource>
    </resources>

    9. 编译:

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.1</version>
    <configuration>
    <source>1.6</source>
    <target>1.6</target>
    <encoding>UTF-8</encoding>
    <excludes>
    <exclude>**/sdh/**</exclude>
    </excludes>
    <testExcludes>
    <testExclude>**/sdh/**</testExclude>
    </testExcludes>
    </configuration>
    </plugin>

  • 相关阅读:
    Servlet3.0之五:servlet3.0下的web.xml
    RESTLET开发实例(二)使用Component、Application的REST服务
    并发容器之ConcurrentLinkedDeque
    script的onerror事件支持情况调查
    纯CSS后台框架
    浏览器对width与height的最大值限制
    DOM系统中的各种队列
    跨域的异步请求四
    JSON parse在各浏览器的兼容性列表
    在IE6~8下创建HTML5新标签
  • 原文地址:https://www.cnblogs.com/hujihon/p/3840001.html
Copyright © 2020-2023  润新知