【问题标题】:Maven - Skip the goal execution by passing parameterMaven - 通过传递参数跳过目标执行
【发布时间】:2014-02-20 20:12:08
【问题描述】:

我正在使用这个 maven 插件:

<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>

我希望能够传入一个参数来跳过指定目标的执行。 (例如mvm install -skipGemPlugin=true) 我该怎么做?

【问题讨论】:

  • 如果您调用mvn tomcat:run,则不会执行 gem-maven-plugin,因为您没有开始生命周期。只执行tomcat插件。
  • 我的tomcat:run 调用了调用gem-maven-plugin 的install 目标。更新了我的问题以反映这一点。
  • 你能显示你的 pom 文件 = 如何调用 tomcat:运行安装目标吗?

标签: maven-3 maven-plugin


【解决方案1】:

我最终创建了一个单独的配置文件来运行 tomcat 并跳过了目标执行:

<profile>
    <id>foo</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>de.saumya.mojo</groupId>
                    <artifactId>gem-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compassProcessSource</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                        ... 

【讨论】:

    【解决方案2】:

    如果你在你的 assembly.xml 和 pom.xml 中调用“bin”

    <descriptorRefs>
    <descriptorRef>bin</descriptorRef>
    </descriptorRefs>
    

    插件使用名为“bin”的默认程序集定义,这让你很恼火!

    解决方案:移除 bin 并诅咒其创建者

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-29
      • 1970-01-01
      • 1970-01-01
      • 2013-01-11
      • 2020-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多