Independent extensions:

RSS Feeds

Pages and Blog posts
Mailing list


How to perform deployments to a remote GlassFish 6.x and later containers


All Cargo GlassFish deployers use the GlassFish asadmin behind the scenes, and all of them set the cargo.hostname as the target host.

As a result, all GlassFish Installed Local Deployers can actually be used to perform remote deployments, the main "downside" being that this requires the GlassFish container ZIP file to be downloaded (which can be done transparently using an installer).

Here is an example code for the users of the Java API:

Installer installer = new ZipURLInstaller(
    "target/downloads", "target/extracts");
InstalledLocalContainer container = new GlassFish6xInstalledLocalContainer(
    new GlassFish6xStandaloneConfiguration("target/glassfish6x"));

// Set the hostname to a running, remote GlassFish 6.0 instance
// for the GlassFish6xInstalledLocalDeployer to perform a remote deployment
container.getConfiguration.setProperty(GeneralPropertySet.HOSTNAME, "");

DeployableFactory factory = new DefaultDeployableFactory();
WAR war = factory.createDeployable(container.getId(), "path/to/my.war",
Deployer deployer = new GlassFish6xInstalledLocalDeployer(container);

Here is an example Maven 3 plugin configuration, where one can use the Maven Artifact Installer:

Copyright 2004-2022. All rights reserved unless otherwise noted.
Click here to read our privacy and cookie policy