zoukankan      html  css  js  c++  java
  • maven test 运行 指定类或方法 打包 mvn clean assembly:assembly

    >mvn test -Dtest=[ClassName]
    运行测试类中指定的方法:(这个需要maven-surefire-plugin:2.7.3以上版本才能支持)
     
    >mvn test -Dtest=[ClassName]#[MethodName]
    //[MethodName]为要运行的方法名,支持*通配符,范例:
    >mvn test -Dtest=MyClassTest#test1
    >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>
  • 相关阅读:
    标准输入/输出通道
    不要在纠结负数的表示了
    Coursera公开课-Machine_learing:编程作业7
    Heap堆
    广义表的实现
    二叉树的实现
    模拟实现strstr和strrstr
    栈和队列常考面试题(二)
    栈和队列常考面试题(一)
    vector迭代器失效的几种情况
  • 原文地址:https://www.cnblogs.com/diegodu/p/6118172.html
Copyright © 2011-2022 走看看