Java 无法在项目ors上执行goal org.codehaus.mojo:exec maven plugin:1.6.0:exec(默认值):参数';可执行文件';丢失或无效

Java 无法在项目ors上执行goal org.codehaus.mojo:exec maven plugin:1.6.0:exec(默认值):参数';可执行文件';丢失或无效,java,maven,Java,Maven,当我试图执行mvn-DskipTests=true-Passembly assembly:directory exec:exec命令以生成二进制文件时,我得到 无法在项目ors上执行目标org.codehaus.mojo:exec maven插件:1.6.0:exec(默认值):参数“executable”丢失或无效错误。我还应用了源目标1.8内部配置,但仍然得到相同的错误 <profile> <id>execute</id> <

当我试图执行mvn-DskipTests=true-Passembly assembly:directory exec:exec命令以生成二进制文件时,我得到 无法在项目ors上执行目标org.codehaus.mojo:exec maven插件:1.6.0:exec(默认值):参数“executable”丢失或无效错误。我还应用了源目标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>

执行
org.codehaus.mojo
execmaven插件
JAVA
org.marketcetera.ors.OrderRoutingSystem
org.marketcetera.appDir
src/test/cmd\u exec
测试
执行比尼特
org.codehaus.mojo
execmaven插件
JAVA
org.marketcetera.ors.DBInit
org.marketcetera.ors.OrderRoutingSystem
org.marketcetera.appDir
src/test/cmd\u exec
测试
交换
org.codehaus.mojo
execmaven插件
JAVA
org.marketcetera.ors.exchange.Main
exchange.xml
org.marketcetera.appDir
src/test/cmd\u exec
测试
cli
org.codehaus.mojo
execmaven插件
JAVA
org.marketcetera.ors.security.ORSAdminCLI
org.marketcetera.appDir
src/test/cmd\u exec
测试
装配
maven汇编插件
包裹
单一的
迪尔
src/main/assembly/assembly.xml
org.codehaus.mojo
execmaven插件
包裹
执行官
${perl.path}
../tools/scripts/createScript.pl
${project.build.directory}/${project.artifactId}
手术室
org.marketcetera.ors.OrderRoutingSystem
${project.build.directory}/${project.artifactId}
奥沙姆
org.marketcetera.ors.security.ORSAdminCLI

您忘记在
标记中指定
perl.path
变量

<executable>${perl.path}</executable>
${perl.path}
将此添加到您的pom父级:

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

path/to/perl

exec maven plugin
1.6.0版开始,除非指定id,否则
块中的
部分将被忽略

尝试更改命令行,替换exec:exec@foo对于exec:exec,插件块更改为包含idfoo,如下所示:

      <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>

org.codehaus.mojo
execmaven插件
福
包裹
执行官
${perl.path}
../tools/scripts/createScript.pl
${project.build.directory}/${project.artifactId}
手术室
org.marketcetera.ors.OrderRoutingSystem
${project.build.directory}/${project.artifactId}
奥沙姆
org.marketcetera.ors.security.ORSAdminCLI

非常感谢您的建议,但我已经在我看到的最后一个标记的标记中维护了${perl.path}。但是您指定了perl.path变量的值吗?我已经在系统变量“C:\Program Files\草莓\perl\bin”中指定了perl.path变量的值。