当我试图执行mvn -DskipTests=true -Passembly程序集:目录exec:exec命令,使二进制我得到未能执行目标org.codehaus.mojo:exec-maven-plugin:1.6.0:exec(默认)项目或:参数“executable”缺失或无效错误。我还在配置中应用了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>
5条答案
按热度按时间jutyujz01#
从
exec-maven-plugin
版本1.6.0开始,除非指定id,否则<execution>
块中的<configuration>
部分似乎会被忽略。尝试更改您的命令行,用exec:exec@foo替换exec:exec,并将插件块更改为包含idfoo,如下所示:
dwthyt8l2#
我通过在pom.xml中指定所需的插件解决了这个错误,如下所示
x9ybnkn63#
您忘记在
<executable>
标记中指定perl.path
变量。将此添加到您的pom父项:
tnkciper4#
在执行前编译
k7fdbhmy5#
如果
exec-maven-plugin
插件是在子maven模块中配置的,并且您从父目录运行该命令,则也可能发生The parameter 'executable' is missing or invalid
错误。要解决这个问题,只需将您的工作目录更改为使用插件的目录。