[英]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.