简体   繁体   English

无法在项目上执行目标 org.codehaus.mojo:exec-maven-plugin:1.6.0:exec(默认):参数“可执行文件”丢失或无效

[英]Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default) on project ors: The parameter 'executable' is missing or invalid

When i am trying to execute mvn -DskipTests=true -Passembly assembly:directory exec:exec command to make binary i am getting Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (default) on project ors: The parameter 'executable' is missing or invalid error.当我尝试执行mvn -DskipTests=true -Passembly assembly:directory exec:exec命令来制作二进制文件时,我得到Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (默认)关于项目 ors:参数“可执行文件”丢失或无效错误。 i have also applied Source Target 1.8 inside configuration but still i am getting the same error.我还在配置中应用了Source Target 1.8 ,但我仍然遇到同样的错误。

<profile>
      <id>execute</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <goals><goal>java</goal></goals>
                  </execution>
              </executions>
          <configuration>
          <mainClass>org.marketcetera.ors.OrderRoutingSystem</mainClass>
          <systemProperties>
              <systemProperty>
                  <key>org.marketcetera.appDir</key>
                  <value>src/test/cmd_exec</value>
              </systemProperty>
          </systemProperties>
          <classpathScope>test</classpathScope>
          </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Command-line execution of the ORS (with DB initialization). -->
    <profile>
      <id>executeDBInit</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <goals><goal>java</goal></goals>
                  </execution>
              </executions>
          <configuration>
        <mainClass>org.marketcetera.ors.DBInit</mainClass>
        <arguments>
          <argument>org.marketcetera.ors.OrderRoutingSystem</argument>
        </arguments>
        <systemProperties>
          <systemProperty>
            <key>org.marketcetera.appDir</key>
            <value>src/test/cmd_exec</value>
          </systemProperty>
        </systemProperties>
        <classpathScope>test</classpathScope>
          </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Command-line execution of the miniscule exchange. -->
    <profile>
      <id>exchange</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <goals><goal>java</goal></goals>
                  </execution>
              </executions>
          <configuration>
        <mainClass>org.marketcetera.ors.exchange.Main</mainClass>
        <arguments>
          <argument>exchange.xml</argument>
        </arguments>
        <systemProperties>
          <systemProperty>
            <key>org.marketcetera.appDir</key>
            <value>src/test/cmd_exec</value>
          </systemProperty>
        </systemProperties>
        <classpathScope>test</classpathScope>
          </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Security administration utility. -->
    <profile>
      <id>cli</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <goals><goal>java</goal></goals>
                  </execution>
              </executions>
          <configuration>
        <mainClass>org.marketcetera.ors.security.ORSAdminCLI</mainClass>
        <!-- -Dexec.args="-u admin ..." -->
        <systemProperties>
          <systemProperty>
            <key>org.marketcetera.appDir</key>
            <value>src/test/cmd_exec</value>
          </systemProperty>
        </systemProperties>
        <classpathScope>test</classpathScope>
          </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Assembly. -->
    <profile>
      <id>assembly</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
              <executions>
                  <execution>
                      <phase>package</phase>
                      <goals><goal>single</goal></goals>
                      <configuration>
                          <formats><format>dir</format></formats>
                          <descriptors>
                              <descriptor>src/main/assembly/assembly.xml</descriptor>
                          </descriptors>
                      </configuration>
                  </execution>
              </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <phase>package</phase>
                      <goals><goal>exec</goal></goals>
                      <configuration>
              <executable>${perl.path}</executable>
                          <arguments>
                              <argument>../tools/scripts/createScript.pl</argument>
                              <argument>${project.build.directory}/${project.artifactId}</argument>
                              <argument>ors</argument>
                              <argument>org.marketcetera.ors.OrderRoutingSystem</argument>
                              <argument>${project.build.directory}/${project.artifactId}</argument>
                              <argument>orsadmin</argument>
                              <argument>org.marketcetera.ors.security.ORSAdminCLI</argument>
                          </arguments>
                      </configuration>
                  </execution>
              </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

As of exec-maven-plugin version 1.6.0, it appears <configuration> sections within <execution> blocks are ignored unless you specify an id.exec-maven-plugin版本 1.6.0 开始,除非您指定 id,否则<execution>块中的<configuration>部分将被忽略。

Try changing your command line, substituting exec:exec@foo for exec:exec with the plugin block changed to include an id foo as follows:尝试更改您的命令行,将exec:exec@foo替换为exec:exec ,并将插件块更改为包含 id foo ,如下所示:

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
          <executions>
              <execution>
                  <id>foo</id>
                  <phase>package</phase>
                  <goals><goal>exec</goal></goals>
                  <configuration>
          <executable>${perl.path}</executable>
                      <arguments>
                          <argument>../tools/scripts/createScript.pl</argument>
                          <argument>${project.build.directory}/${project.artifactId}</argument>
                          <argument>ors</argument>
                          <argument>org.marketcetera.ors.OrderRoutingSystem</argument>
                          <argument>${project.build.directory}/${project.artifactId}</argument>
                          <argument>orsadmin</argument>
                          <argument>org.marketcetera.ors.security.ORSAdminCLI</argument>
                      </arguments>
                  </configuration>
              </execution>
          </executions>
      </plugin>

You forgot to specify perl.path variable in <executable> tag.您忘记在<executable>标签中指定perl.path变量。

<executable>${perl.path}</executable>

Add this to your pom parent:将此添加到您的 pom 父级:

<properties>
    <perl.path>path/to/perl</perl.path>       
</properties>

I resolved this error by specifying the required plugin in pom.xml as follows我通过在 pom.xml 中指定所需的插件来解决这个错误,如下所示

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <executable>java</executable>
                    <arguments>
                        <argument>-classpath</argument>
                        <classpath />
                        <argument>com.ocloud.Alarm.App</argument>
                    </arguments>
                </configuration>
            </plugin>

Just compile before execution执行前编译

clean compiler:compile exec:java

This error The parameter 'executable' is missing or invalid can also happen if the exec-maven-plugin plugin is configured in a child maven module and you run the command from the parent directory.如果在子 maven 模块中配置了exec-maven-plugin插件,并且您从父目录运行命令,也会发生此错误The parameter 'executable' is missing or invalid

To fix that, simple change your working directory to where the plugin is used.要解决这个问题,只需将您的工作目录更改为使用插件的位置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在项目上执行目标org.codehaus.mojo:exec-maven-plugin:1.6.0:java(default-cli) <project-name> : - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project <project-name>: 目标 org.codehaus.mojo:exec-maven-plugin:1.6.0:java 的参数“mainClass”丢失或无效 - The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java are missing or invalid 无法执行目标org.codehaus.mojo:exec-maven-plugin:1.6.0:java - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java 无法执行目标 org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) 无法在项目上执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli):命令执行失败 - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project: Command execution failed 无法在项目SpringData上执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli) - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project SpringData 无法在项目 mavenproject2 上执行目标 org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (default): - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (default) on project mavenproject2: Maven错误:无法执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec - Maven error: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec Smooks-无法执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec - Smooks - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 无法执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec( - Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM