偶然我将Maven JBoss插件更新到1.3.2版本。之后,部署无声地失败,没有尝试连接JBoss。最终我们发现版本更改并恢复为旧版本。
这是当前的配置:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<serverName>default</serverName>
<hostName>localhost</hostName>
<port>8080</port>
<deployUrlPath>
/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=
</deployUrlPath>
<undeployUrlPath>
/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=undeploy&argType=java.net.URL&arg0=
</undeployUrlPath>
<fileName>
${project.build.directory}/${project.build.finalName}.${project.packaging}
</fileName>
</configuration>
</plugin>
......和......
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<configuration>
<fileName>${basedir}/target/${application.name}.ear</fileName>
<server>jBoss</server>
</configuration>
<executions>
<execution>
<id>deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
我浏览了插件的更改列表,但我没有发现任何配置更改。有什么建议吗?
答案 0 :(得分:1)
使用mvn jboss:deploy
选项运行-X
表示Maven 2.x JBoss插件的1.3.2版本不再读取fileName
:
[DEBUG] Configuring mojo 'org.codehaus.mojo:jboss-maven-plugin:1.3.2:deploy' --> [DEBUG] (f) deployUrlPath = /jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0= [DEBUG] (f) fileNameEncoding = UTF-8 [DEBUG] (f) hostName = localhost [DEBUG] (f) port = 8080 [DEBUG] -- end configuration --
从版本1.3.2开始,Maven 2.x JBoss插件能够部署 List 文件,因此您需要对其进行如下配置:
<fileNames>
<fileName>
${project.build.directory}/${project.build.finalName}.${project.packaging}
</fileName>
</fileNames>
这次,部署成功,如mvn jboss:deploy -X
的新输出所示:
[DEBUG] Configuring mojo 'org.codehaus.mojo:jboss-maven-plugin:1.3.2:deploy' --> [DEBUG] (f) deployUrlPath = /jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0= [DEBUG] (f) fileNameEncoding = UTF-8 [DEBUG] (f) fileNames = [/home/pascal/Projects/q1366663/target/q1366663.war] [DEBUG] (f) hostName = localhost [DEBUG] (f) port = 8080 [DEBUG] -- end configuration -- [INFO] [jboss:deploy {execution: default-cli}] [INFO] Deploying %2Fhome%2Fpascal%2FProjects%2Fq1366663%2Ftarget%2Fq1366663.war to JBoss. [DEBUG] url = http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=deploy&argType=java.net.URL&arg0=%2Fhome%2Fpascal%2FProjects%2Fq1366663%2Ftarget%2Fq1366663.war
此更改是由于MJBOSS-11(在更改集4282中已修复)而没有任何“修订版本/ ,因此未出现在发行说明中(这是不好的)。