Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven发布插件以跳过pom.xml中的编译和运行测试设置_Maven_Maven Release Plugin_Maven Surefire Plugin - Fatal编程技术网

Maven发布插件以跳过pom.xml中的编译和运行测试设置

Maven发布插件以跳过pom.xml中的编译和运行测试设置,maven,maven-release-plugin,maven-surefire-plugin,Maven,Maven Release Plugin,Maven Surefire Plugin,使用maven release plugin,我已经尝试了所有可能的方法(也在命令行上),来跳过编译我的测试,但到目前为止还没有成功。我想跳过pom。这就是我的pom.xml的外观 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId>

使用maven release plugin,我已经尝试了所有可能的方法(也在命令行上),来跳过编译我的测试,但到目前为止还没有成功。我想跳过pom。这就是我的pom.xml的外观

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
            <arguments>-Dmaven.test.skip</arguments>
            <goals>deploy</goals>
          </configuration>
        </plugin>

org.apache.maven.plugins
但无法让它工作

绝对可靠 但是没有运气

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

org.apache.maven.plugins
maven surefire插件
2.12.4
真的

请使用maven发布插件帮助修复我的pom.xml

首先,您需要弄清楚如何在没有maven发布插件的情况下解决这个问题。测试类的编译由
org.apache.maven.plugins:maven编译器plugin:testCompile
完成,而执行由
org.apache.maven.plugins:maven surefire plugin:test
完成。
所以这是可能的,但也许真正的问题是:你为什么想要这个?这不是解决真正原因的方法吗?

AFAIK这只能通过在命令行上设置

-Darguments="-Dmaven.test.skip=true -DskipTests"

我在测试中遇到了一些依赖性问题,导致构建失败,我想暂时绕过这个问题来测试我所做的一些代码更改。我对maven完全是新手,我正在做的项目有这个pom和测试配置,所以我想跳过它。为什么你没有在版本控制中使用分支来完成类似的事情呢?除了Rober已经提到的-DskipTests选项是必须的吗?
maven.test.skip=true
跳过编译测试,
skipTests
跳过运行测试。@MarcelStör No,maven.test.skip也跳过运行测试:“将此设置为”true“完全绕过单元测试。不建议使用它,特别是如果使用“maven.test.skip”属性启用它,因为maven.test.skip会禁用运行测试和编译测试。请考虑使用SkIPTestPosits。“@ BrdBug,谢谢,让它更有意义。抱歉,我的记忆在这方面没有发挥作用。