IMO最良の方法は、再デプロイのためのEARおよび貨物のMavenプラグインを構築するためにMavenを使用することです。私がそれを使う理由は、それが完全にIDEに依存せず、開発と私の継続的な統合サーバーの両方で使うことができるからです。 GlassfishのためのEAR/WARモジュールの
のpom.xmlフラグメント:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<container>
<containerId>glassfish2x</containerId> <!-- or glassfish3x -->
<type>installed</type>
<home>${glassfish.home}</home>
</container>
<configuration>
<properties>
<cargo.remote.password>${glassfish.password}</cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>installed</type>
<deployables>
<deployable>
<location>${project.build.directory}/${project.build.finalName}.${project.packaging}</location>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>
再デプロイコマンド:
mvn cargo:redeploy -Dglassfish.home=/path/to/glassfish/-Dglassfish.password=adminadmin -DskipTests=true -o
あなたはそれが何であるかわからない場合は、Mavenの2について学ぶ必要があります。
まずGlassFishを起動して実行します。zipファイルをダウンロードして解凍し、glassfish/binで適切なスクリプトを実行します。ポート4848で管理コンソールを見ることができるはずです。 –