我用maven为JBoss 7创建了一个web应用程序,在执行maven任务期间,会创建一个war。这是我的pom.xml
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<build>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.5.Final</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9999</port>
<name>webAdmin</name>
<username>administrator</username>
<password>mypassword</password>
</configuration>
</plugin>
</plugins>
<finalName>webAdmin</finalName>
</build>
<repositories>
<repository>
<id>lightadmin-nexus-releases</id>
<url>http://lightadmin.org/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.lightadmin</groupId>
<artifactId>lightadmin</artifactId>
<version>1.0.0.M2</version>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-managed</artifactId>
<version>7.1.1.Final</version>
<scope>test</scope>
</dependency>
</dependencies>
这就是我为它创建的web.xml。
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Ifrit Web Administration 1.0</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>因此,创建了webAdmin.war文件,如果我手动部署它(也就是说,我转到Jboss控制台并在“管理部署”下部署它),我可以在[http://localhost:8080/webAdmin]下成功地看到index.jsp。
当我尝试使用maven : deploy部署它时,问题就出现了。
以下是我所遵循的步骤:
我看到了另一个这样的例子,如果有人想把它标记为重复的My web project does not work on JBoss 7 when deployed by maven,但我仍然无法使它工作。我也创建了一个EAR文件,一个JBos-web.xml,但是它没有出现。
是否有一种方法可以知道Jboss签署的上下文根是什么?或者任何提示,为什么它会在手动部署和使用maven部署时工作呢?
谢谢
亚历杭德罗
发布于 2014-01-09 01:20:48
显然,JBoss无法识别您部署的工件的类型。尝试从插件配置中的部署名称中澄清这一点:
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.5.Final</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9999</port>
***<name>webAdmin.war</name>***
<username>administrator</username>
<password>mypassword</password>
</configuration>
</plugin>发布于 2013-12-04 01:17:15
我绝不是专业人士,但当我把我的网络应用部署到jboss上时,我也被各种各样的小事困住了。
我不知道在对代码进行更改之后是否刷新maven构建,但我发现这非常有助于保持安静。
使用maven进行部署通常需要3个步骤(来自JBossDevStudio)。作为"maven干净“运行,作为"maven生成源”运行,作为"maven构建“运行。键入运行环境中的目标(tomcat:run )
希望能帮上忙!
https://stackoverflow.com/questions/20364769
复制相似问题