【问题标题】:How to run JBoss 6.2 EAP server using maven and jboss-as-maven-plugin?如何使用 maven 和 jboss-as-maven-plugin 运行 JBoss 6.2 EAP 服务器?
【发布时间】:2014-09-08 06:49:13
【问题描述】:

我正在尝试将一个简单的 Web 应用程序 maven 项目部署到 jboss eat 6.2,我想启动服务器并从 maven 内部部署项目。

这是我的 pom.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.skiabox.webapps</groupId>
    <artifactId>Tmt-Project2</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <version>7.5.Final</version>
                <executions>
                    <execution>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jbossHome>/Users/Administrator/Servers/jboss-eap-6.2/bin</jbossHome>
                    <hostname>localhost</hostname>
                    <username>user1</username>
                    <password>password1</password>
                    <port>10001</port>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>

我在安装 mvm 后遇到的错误如下:

[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:run (default) on project Tmt-Project2: Modules path 'null' is not a valid directory.

好像maven看不到我在配置标签里给的服务器目录。

【问题讨论】:

  • 模块路径 (docs.jboss.org/jbossas/7/plugins/maven/latest/…) 看起来是强制性的。我猜它可能源自jbossHome,但也许并非如此。顺便说一句,我不会使用“jboss-eap-6.2/bin”作为家,而是使用“jboss-eap-6.2”

标签: java maven jboss


【解决方案1】:

我试图重现你的问题:(我在 Windows 7 下只安装了 Jboss AS 6.0)

  1. 我将你的 pom.xml 复制到了一个空目录中
  2. 我从 JbossHome 路径中删除了“/bin”并使用了完整路径(从驱动器号开始)
  3. 我删除了凭据,因为我的服务器实例没有任何配置
  4. mvn clean install 后服务器正常启动

所以问题可能是: JbossHome 路径或凭据或您在 jbossHome 下的一些配置文件

【讨论】:

  • 路径末尾的 bin 确实是问题所在!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-26
  • 1970-01-01
  • 2012-03-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多