如何使用maven插件將maven web應用程序部署到本地安裝的glassfish服務器?如何將Maven Web應用程序部署到本地安裝的Glassfish?
換句話說,如果我有一個包裝=戰爭的maven項目,可以使用像「mvn clean package some-plugin:goal-deploy」這樣的命令部署到本地安裝的glassfish中?
如何使用maven插件將maven web應用程序部署到本地安裝的glassfish服務器?如何將Maven Web應用程序部署到本地安裝的Glassfish?
換句話說,如果我有一個包裝=戰爭的maven項目,可以使用像「mvn clean package some-plugin:goal-deploy」這樣的命令部署到本地安裝的glassfish中?
是,能夠使用Cargo Maven Plugin,因爲它是自解釋在下面的例子:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>glassfish4x</containerId>
<type>installed</type>
<!-- Path to directory where glassfish is installed -->
<home>C:/programs/glassfish4</home>
</container>
<configuration>
<type>existing</type>
<!-- Path to domains directory -->
<home>C:/programs/glassfish4/glassfish/domains</home>
<properties>
<!-- Domain name where application will be deployed. -->
<cargo.glassfish.domain.name>domain1</cargo.glassfish.domain.name>
<!-- Glassfish user to authenticate -->
<cargo.remote.username>admin</cargo.remote.username>
<!-- Glassfish password to authenticate -->
<cargo.remote.password></cargo.remote.password>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
的行家命令,使用插件上面引用部署有:
mvn clean package cargo:deploy
或
clean package cargo:redeploy
您需要指定插件的版本。 Maven版本3給了我一些關於這個問題的警告。