ant*_*ant 1 java eclipse maven-2
我已经成功构建了我的项目.我的战争位于目标目录,我试图在jboss上运行战争这里是pom.xml的一部分,说jboss在哪里寻找战争..
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<jbossHome>C:\jboss-4.2.2.GA</jbossHome>
<serverName>all</serverName>
<fileName>target/0.0.1-SNAPSHOT.war</fileName>
</configuration>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
现在我用maven开始吧这里是消息:
[INFO] [jboss:start]
[INFO] Starting JBoss...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
Run Code Online (Sandbox Code Playgroud)
但是当地人没有工作,我忘了怎么办?
我没有看到hard-deploy,并start在你的POM目标(后者显然是在某个地方,如果你得到这个输出,从您的文章只是失踪).此外,我使用自己的服务器配置而不是all- 但这不应该在理论上产生很大的不同.fileName插件不使用该属性,您不需要它.如果正确部署JBoss,JBoss会自动找到你的war文件(这就是你需要这个hard-deploy目标的原因).
我的配置如下所示:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.4.sp1</version>
<configuration>
<jbossHome>...</jbossHome>
<serverName>MyServer</serverName>
</configuration>
<executions>
<execution>
<id>redeploy-and-restart-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>hard-deploy</goal>
<goal>start</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
请注意,如果您将服务器绑定到localhost和JNDI端口1099,JBoss maven插件才能正常工作.我想如果您使用的是all服务器配置,那么您没有篡改这些设置,但不过我们还是很高兴知道.
如果您的服务器仍未运行,则应检查all/log目录中的日志文件以查看正在进行的操作.