Module org.wildfly.plugin.core
Class BootableJarSupport
- java.lang.Object
-
- org.wildfly.plugin.tools.bootablejar.BootableJarSupport
-
public class BootableJarSupport extends Object
Various utilities for packing a bootable JAR.- Author:
- jdenise, James R. Perkins
-
-
Field Summary
Fields Modifier and Type Field Description static StringBOOTABLE_SUFFIXstatic StringJBOSS_MODULES_ARTIFACT_IDstatic StringJBOSS_MODULES_GROUP_IDstatic StringWILDFLY_ARTIFACT_VERSIONS_RESOURCE_PATH
-
Constructor Summary
Constructors Constructor Description BootableJarSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbuildJar(Path contentDir, Path jarFile, ScannedArtifacts bootable, org.jboss.galleon.universe.maven.repo.MavenRepoManager resolver)Builds a JAR file for the bootable JAR.static voidpackageBootableJar(Path targetJarFile, Path workDir, org.jboss.galleon.api.config.GalleonProvisioningConfig config, Path serverHome, org.jboss.galleon.universe.maven.repo.MavenRepoManager resolver, org.jboss.galleon.MessageWriter writer)Package a server as a bootable JAR.static ScannedArtifactsscanArtifacts(org.jboss.galleon.api.Provisioning pm, org.jboss.galleon.api.config.GalleonProvisioningConfig config, org.jboss.galleon.MessageWriter writer)Scans the provisioning session for required artifacts.static voidunzipCloudExtension(Path contentDir, String version, org.jboss.galleon.universe.maven.repo.MavenRepoManager resolver)Resolves the cloud extension for the version provided.static voidzipServer(Path source, Path targetDir)Creates a ZIP archive for the server.static voidzipServer(Path source, Path targetDir, String zipFileName)Creates a ZIP archive for the server.
-
-
-
Field Detail
-
BOOTABLE_SUFFIX
public static final String BOOTABLE_SUFFIX
- See Also:
- Constant Field Values
-
JBOSS_MODULES_GROUP_ID
public static final String JBOSS_MODULES_GROUP_ID
- See Also:
- Constant Field Values
-
JBOSS_MODULES_ARTIFACT_ID
public static final String JBOSS_MODULES_ARTIFACT_ID
- See Also:
- Constant Field Values
-
WILDFLY_ARTIFACT_VERSIONS_RESOURCE_PATH
public static final String WILDFLY_ARTIFACT_VERSIONS_RESOURCE_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
packageBootableJar
public static void packageBootableJar(Path targetJarFile, Path workDir, org.jboss.galleon.api.config.GalleonProvisioningConfig config, Path serverHome, org.jboss.galleon.universe.maven.repo.MavenRepoManager resolver, org.jboss.galleon.MessageWriter writer) throws IOException, org.jboss.galleon.ProvisioningException
Package a server as a bootable JAR.- Parameters:
targetJarFile- the path to the JAR file to createworkDir- the working directory used to generate and store contentconfig- the Galleon provisioning configurationserverHome- the server directoryresolver- the Maven resolver used to resolve artifactswriter- the message writer where messages will be written to- Throws:
IOException- if an error occurs packaging the bootable JARorg.jboss.galleon.ProvisioningException- if an error occurs packaging the bootable JAR
-
unzipCloudExtension
public static void unzipCloudExtension(Path contentDir, String version, org.jboss.galleon.universe.maven.repo.MavenRepoManager resolver) throws org.jboss.galleon.universe.maven.MavenUniverseException, IOException
Resolves the cloud extension for the version provided. It then unpacks the extension into the content directory.- Parameters:
contentDir- the directory the cloud extension should be extracted toversion- the version of the cloud extension to useresolver- the Maven resolver used to resolve the cloud extension- Throws:
org.jboss.galleon.universe.maven.MavenUniverseException- if an error occurs while resolving the artifactIOException- if en error occurs extracting the extension
-
zipServer
public static void zipServer(Path source, Path targetDir) throws IOException
Creates a ZIP archive for the server. The archive name will bewildfly.zip.- Parameters:
source- path for the content to archivetargetDir- the target directory for the archive to be created in- Throws:
IOException- if an error occurs creating the archive
-
zipServer
public static void zipServer(Path source, Path targetDir, String zipFileName) throws IOException
Creates a ZIP archive for the server.- Parameters:
source- path for the content to archivetargetDir- the target directory for the archive to be created inzipFileName- the of the archive to create- Throws:
IOException- if an error occurs creating the archive
-
scanArtifacts
public static ScannedArtifacts scanArtifacts(org.jboss.galleon.api.Provisioning pm, org.jboss.galleon.api.config.GalleonProvisioningConfig config, org.jboss.galleon.MessageWriter writer) throws org.jboss.galleon.ProvisioningException
Scans the provisioning session for required artifacts. These includejboss-modules, thewildfly-jar-bootartifact and CLI artifacts.- Parameters:
pm- the provisioning sessionconfig- the provisioning configurationwriter- the message writer- Returns:
- the scanned artifacts
- Throws:
org.jboss.galleon.ProvisioningException- if an error occurs scanning
-
buildJar
public static void buildJar(Path contentDir, Path jarFile, ScannedArtifacts bootable, org.jboss.galleon.universe.maven.repo.MavenRepoManager resolver) throws IOException, org.jboss.galleon.universe.maven.MavenUniverseException
Builds a JAR file for the bootable JAR.- Parameters:
contentDir- the directory which stores the bootable JAR's contentjarFile- the target JAR filebootable- the scanned artifactsresolver- the Maven resolver used to resolve artifacts- Throws:
IOException- if an error occurs building the JARorg.jboss.galleon.universe.maven.MavenUniverseException- if an error occurs resolving artifacts
-
-