我很头疼想要安装maven-as-plugin.
我的目标是在运行集成测试之前重新部署ear。我希望这个过程是自动的,把它集成到CI中。
服务器是一个远程运行的JBoss服务器(作为7)。
由于Jboss的臭名昭著的PermGen空间问题,我需要在部署ear之前重新启动服务器。否则,服务器每5次运行一次.
为此,我尝试使用设置一个目标“reload=true关机”。问题是,maven插件不会在运行下一个目标(清理以前的工件)之前等待它完成。
以下是我的POM的摘录:
<!-- Jboss Deploy/undeploy application EAR -->
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.5.Final</version>
<configuration>
<!-- JBoss management -->
<hostname>${sanity.tests.jboss.host}</hostname>
<port>${sanity.tests.management.port}</port>
<username>${sanity.tests.jboss.username}</username>
<password>${sanity.tests.management.password}</password>
</configuration>
<executions>
<!-- Reload Jboss to avoid permgen space -->
<execution>
<id>restart</id>
<phase>pre-integration-test</phase>
<goals><goal>shutdown</goal></goals>
<configuration>
<reload>true</reload>
</configuration>
</execution>
<!-- Undeploy previous ear -->
<execution>
<id>undeploy</id>
<phase>pre-integration-test</phase>
<!-- Cleanup : Undeploy -->
<goals>
<goal>undeploy</goal>
</goals>
<configuration>
<matchPattern>rm-app.*.ear</matchPattern>
<ignoreMissingDeployment>true</ignoreMissingDeployment>
</configuration>
</execution>
<!-- Deploy before int test -->
<execution>
<id>deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy-artifact</goal>
</goals>
<configuration>
<name>xxxx</name>
<groupId>xxxxx</groupId>
<artifactId>xxxx</artifactId>
<version>${project.version}</version>
</configuration>
</execution>
</executions>
</plugin>任何帮助都将不胜感激。
发布于 2014-02-11 01:58:24
尝试先运行undeploy。如果这是AS上唯一的ear,那么重新加载很可能足够快,从而使部署目标不再超时。
<goals>
<goal>undeploy</goal>
<goal>shutdown</goal>
<goal>deploy</goal>
</goals>不幸的是,我不知道如何增加部署目标的超时。
发布于 2014-08-04 13:24:48
我也有同样的问题。开关的建议(在重新启动JBoss之前首先取消部署)肯定会有所帮助。在服务器重新启动和重新部署之间添加了一段时间后,我做的另一件事是将服务器的卸载和重新启动绑定到构建过程的一个非常早期的步骤(例如初始化),而部署步骤则绑定到进程-资源或预集成测试,就像在您的情况下一样。这是因为我在一个单独的集成测试模块中部署了我的工件,它首先使用maven依赖插件将所有相关的服务器构件复制到${project.build.directory}/dependency文件夹中,作为第一步之一。但我同意这不是一个很好的解决方案,对于独立的JBoss节点使用阻塞重新启动cli命令会好得多。
发布于 2015-08-11 02:51:07
事实上,关闭目标并不能解决PermGen问题。我用cli解决了这个问题。
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.5.Final</version>
<configuration>
<afterDeployment>
<commands>
<command>/host=master:shutdown(restart=true)</command>
</commands>
</afterDeployment>
<!-- your configuration -->
...
</configuration>
<plugin>“主”是域模式下主机的名称。
https://stackoverflow.com/questions/20956520
复制相似问题