繁体   English   中英

使用 maven 将应用程序运行到嵌入式 jboss 服务器

[英]Run app to embedded jboss server using maven

我通过这篇文章http://buraktas.com/resteasy-example-without-using-a-web-xml/使用 resteasy 和 maven 作为构建工具创建了简单的休息服务器应用程序。 或者可以使用 maven 向嵌入式 jboss 服务器运行创建的战争? 我想实现这个场景: 1. 我用源文件和 pom.xml 将我的项目推送到 git hub 2. 用户克隆 repo 并使用 maven 构建和运行应用程序。 3. 转到浏览器http://localhost:8080/rest-helloworld/helloworld并获取 hello msg。

pom.xml <- 现在需要mvn clean install来准备 .war 并需要复制粘贴到应用程序服务器。 我想跳过这一步。

<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>buraktas.com</groupId>
  <artifactId>rest-helloworld</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>

  <name>rest-helloworld</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>3.0.6.Final</version>
        <scope>provided</scope>
    </dependency>
  </dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <warName>rest-helloworld</warName>
            </configuration>
        </plugin>
    </plugins>
</build>


</project>

您可以使用Maven JBoss 插件来使用Maven执行启动/停止和部署/取消部署任务。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM