gpt4 book ai didi

maven - 如何将 Maven Web 应用程序部署到本地安装的 Glassfish?

转载 作者:行者123 更新时间:2023-12-04 14:48:13 24 4
gpt4 key购买 nike

如何仅使用 Maven 插件将 Maven Web 应用程序部署到本地安装的 glassfish 服务器?

换句话说,如果我有一个带有 Packaging=war 的 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>

使用上面引用的插件部署的 maven 命令是:
mvn clean package cargo:deploy

或者
clean package cargo:redeploy

关于maven - 如何将 Maven Web 应用程序部署到本地安装的 Glassfish?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42273099/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com