zoukankan      html  css  js  c++  java
  • MVN TEST指定运行脚本

    clean:表示将你上一次编译生成的一些文件删除

    test:表示只执行测试代码

    >mvn clean test -Dtest=[ClassName]

    运行测试类中指定的方法:这个需要maven-surefire-plugin 2.7.3以上的版本才能支持

    >mvn clean test -Dtest=[ClassName]#[MethodName]

    //MethodName为要运行的方法名,支持*通配符

    例如:

    >mvn test -Dtest=MyClassTest#*test*

     

    mvn clean assembly:assembly 生产jar包,在target文件夹下面,在pom.xml中添加下面的插件

    可用 java -jar target/xxx.jar main函数参数列表的形式 运行jar包

     

    <build>
      <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <finalName>打包后生成的jar包的名字</finalName>
          <appendAssemblyId>false</appendAssemblyId>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <mainClass>jar包的入口,也就是想要调用的main函数所在的包</mainClass>
            </manifest>
          </archive>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      </plugins>
      </build>

     

     

  • 相关阅读:
    poj 3669 Meteor Shower
    poj 3009 Curling 2.0
    poj 1979 Red and Black
    区间内素数的筛选
    九度oj 题目1347:孤岛连通工程
    poj 3723 Conscription
    poj 3255 Roadblocks
    Luogu P3975 [TJOI2015]弦论
    AT2165 Median Pyramid Hard 二分答案 脑洞题
    后缀自动机多图详解(代码实现)
  • 原文地址:https://www.cnblogs.com/wysk/p/9520676.html
Copyright © 2011-2022 走看看