我正在尝试在自定义容器的顶部执行我的应用程序部署的集成品尝.由于我的容器是自定义的,我不能使用Maven Cargo插件来设置容器.
我的容器:
我的问题是我必须在不同的进程中运行我的容器,因为它需要在我的测试执行时继续运行.此外,我的测试中有一个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中运行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) 我使用的是 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 不应该考虑安装它的需要吗?
任何有关如何解决此问题的建议都将受到赞赏。