Eclipse - maven - 我应该执行什么目标,从maven实际部署到Wildfly(实现与“运行在服务器”eclipse命令相同的结果) [英] Eclipse - maven - what goal should I execute to actually deploy to Wildfly from maven (achieve the same result as the "run on server" eclipse command)

查看:179
本文介绍了Eclipse - maven - 我应该执行什么目标,从maven实际部署到Wildfly(实现与“运行在服务器”eclipse命令相同的结果)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的maven - 我有一个eclipse项目,我可以右键单击>运行为...>在服务器上运行,并在我的本地Wildfly安装上成功运行。有没有一种方法可以使用RClick> Run as ... ,并选择一个适当的maven目标来实现相同的效果(即作为一个战争的包,复制到服务器目录(重新)盯着服务器)?我需要使用wildfly maven插件吗?



对于tomcat来说,类似的问题:



编辑:我现在在Wildfly - 所以我相应地编辑了



最接近的是:

 < plugin> 
< groupId> org.wildfly.plugins< / groupId>
< artifactId> wildfly-maven-plugin< / artifactId>
< version> 1.0.2.Final< / version>
< configuration>
< jbossHome> C:/ _ / wildfly-8.1.0.Final< / jbossHome>
< / configuration>
< / plugin>

但是我想避免对那里的路径进行硬编码 - 我该怎么办?

解决方案

您可以使用jboss插件

  ;插件> 
< groupId> org.jboss.as.plugins< / groupId>
< artifactId> jboss-as-maven-plugin< / artifactId>
< version> 7.5.Final< / version>
< / plugin>

然后设置目标为:jboss-as:deploy clean



它将在JBoss服务器上部署war。


New to maven - I have an eclipse project that I can Right click > Run as... > Run on server and it runs successfully on my local Wildfly installation. Is there a way to RClick> Run as... and choose an appropriate maven goal to achieve the same effect (ie package as a war, copy to the servers dir (re)staring the server) ? Do I need to use a "wildfly maven plugin" ?

Similar question for tomcat: maven deploy goal failing

I am on eclipse Luna Java EE pack, maven 3.1 (the one that comes with eclipse) and using Wildfly 8.1.0.Final

Related:

EDIT: I am now on Wildfly - so I edited accordingly

The closest I got was:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>1.0.2.Final</version>
    <configuration>
        <jbossHome>C:/_/wildfly-8.1.0.Final</jbossHome>
    </configuration>
</plugin>

but I would like to avoid hardcoding the path there - how should I proceed ?

解决方案

You can use jboss plugin

        <plugin>
            <groupId>org.jboss.as.plugins</groupId>
            <artifactId>jboss-as-maven-plugin</artifactId>
            <version>7.5.Final</version>
        </plugin>

Then set goal as: "jboss-as:deploy clean"

It will deploy war on JBoss server.

这篇关于Eclipse - maven - 我应该执行什么目标,从maven实际部署到Wildfly(实现与“运行在服务器”eclipse命令相同的结果)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆