相关疑难解决方法(0)

使用Maven exec插件启动Windows批处理脚本会阻止构建,即使脚本使用"start"

我正在尝试在自定义容器的顶部执行我的应用程序部署的集成品尝.由于我的容器是自定义的,我不能使用Maven Cargo插件来设置容器.

我的容器:

  • 必须通过正确的bat文件启动,该文件位于运行测试的机器的路径中.
  • 可以手动关闭,因为我有一个包含所有集成测试的maven模块,即使有一天我想知道如何在测试完成后关闭进程.

我的问题是我必须在不同的进程中运行我的容器,因为它需要在我的测试执行时继续运行.此外,我的测试中有一个API,让我等待容器准备就绪(一种带超时的查找).

我已将以下行添加到我的pom.xml中

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.1</version>
            <executions>
                <execution>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <executable>scripts/start-agent.bat</executable>
            </configuration>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

这将调用一个仅包含的脚本

开始调用gs-agent.bat

然而,mvn exec插件被卡住了,我的测试没有运行.根据我如何从Java应用程序运行批处理文件中的建议,我已经修改了我的pom.xml如下:

 <configuration>
                <executable>cmd</executable>
                <arguments>
                    <argument>/C</argument>
                    <argument>start</argument>
                    <argument>gs-agent.bat</argument>
                </arguments>
            </configuration>
Run Code Online (Sandbox Code Playgroud)

但这似乎没有解决问题:

Maven停了下来

maven-3 maven exec-maven-plugin

21
推荐指数
2
解决办法
4万
查看次数

CreateProcess error = 193,%1不是有效的Win32应用程序 - > [帮助1]

在maven中运行exec-npm-update时,我收到以下错误:CreateProcess error = 193,%1不是有效的Win32应用程序 - > [帮助1]

下面是pom文件的片段.

<execution>
                <id>exec-npm-update</id>
                <phase>generate-sources</phase>
                <configuration>
                  <workingDirectory>${uiResourcesDir}</workingDirectory>
                  <executable>npm</executable>
                  <arguments>
                    <argument>update</argument>
                  </arguments>
                </configuration>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
Run Code Online (Sandbox Code Playgroud)

maven node.js angularjs

8
推荐指数
2
解决办法
9913
查看次数

Maven 执行目标失败 - 无法运行程序 npm

我使用的是 Windows 7 计算机,并且获得了必须运行“mvn install”才能构建应用程序的代码。当我这样做时,我收到以下错误:

无法在项目 [project] 上执行目标 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (npm-install):命令执行失败。:无法运行程序“npm”(在目录“C:\”中) Users\path\to\a\folder"): CreateProcess error=2, 系统找不到指定的文件

该应用程序本身分为几个部分,其中之一是 npm 所使用的 Angular 应用程序。

我尝试安装nodejs(我不太熟悉)并将其包含在PATH中,但还是发生了同样的错误。maven 不应该考虑安装它的需要吗?

任何有关如何解决此问题的建议都将受到赞赏。

windows maven node.js npm angular

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

maven ×3

node.js ×2

angular ×1

angularjs ×1

exec-maven-plugin ×1

maven-3 ×1

npm ×1

windows ×1