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)

ⅰ亾dé卋堺 提交于 2019-12-01 09:50:36

问题


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:

  • One click build and deploy using Eclipse/Maven/JBoss AS 7

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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/24263196/eclipse-maven-what-goal-should-i-execute-to-actually-deploy-to-wildfly-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!