如何使用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给了我一些关于这个问题的警告。