2017-04-22 41 views
1

当我试图执行mvn -DskipTests = true -Passembly程序集:目录exec:exec命令使我得到的二进制文件 未能执行目标org.codehaus.mojo:exec-maven-plugin:1.6.0:exec(缺省值)on project ors:参数'可执行'丢失或无效错误。我也应用源目标1.8里面的配置,但我仍然得到相同的错误。未能执行目标org.codehaus.mojo:exec-maven-plugin:1.6.0:exec(默认)对项目或者:参数'executable'缺失或无效

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

回答

0

你忘了<executable>标记指定perl.path变量。

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

添加到您的POM父:

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

谢谢各位大大的YOUE suggetion,但我已经在最后标记 –

+0

标记中保留了 $ {perl.path}我明白了。但是你指定了perl.path变量的值吗? – sovas

+0

我已经在系统变量“C:\ Program Files \ strawberry \ perl \ bin”中指定了perl.path变量的值。 –

0

随着1.6.0 exec-maven-plugin版本,它,除非你指定的ID出现内<execution>块被忽略<configuration>部分。

试着改变你的命令行,代EXEC:EXEC @富高管:EXEC与改变包括ID 插件模块如下:

 <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> 
相关问题