DeveloperWeb

  Dashboard > GX DeveloperWeb > ... > How Tos > Creating a Webmanager Component Archive
Creating a Webmanager Component Archive Log In | Sign Up   View a printable version of the current page.

Added by patricka@gx.nl , last edited by williamb@gx.nl on Oct 05, 2009  (view change)
Labels: 

This information is for WCB's based on pre-WM 9.7 archetypes.
From WM 9.7 on, the archetypes contain the things described below.

A Webmanager Component Bundle contains the bare necessities for a functional component. It is possible to create a Web Component Archive to store additional information with a WCB; think of the source code or Javadoc documentation. Creating a WCA is similar to creating a WCB, below are instructions how to do it.

Add the red colored code snippets to your "pom.xml":

 	<build>
		<plugins>

			<!-- plugin to create the javadoc on the package phase -->
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>create-javadoc</id>
						<phase>package</phase>
						<goals>
							<goal>javadoc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- plugin to create the distribution zip on the package phase -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<id>assemble-zip</id>
						<phase>package</phase>
						<goals>
							<goal>attached</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<descriptors>
						<descriptor>src/main/assembly/dist-assembly.xml</descriptor>
					</descriptors>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<reporting>
		<plugins>
			<!-- plugin to create the javadoc -->
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<reportOutputDirectory>target/apidocs</reportOutputDirectory>
				</configuration>
			</plugin>
		</plugins>
	</reporting>


Copy the contents below to a file in your WCB directory structure named "src/main/assembly/dist-assembly.xml":

 <?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/ASSEMBLY" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/ASSEMBLY http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
    <id>dist</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <includeSiteDirectory>false</includeSiteDirectory>
    <fileSets>

        <!-- include the readme.txt, changelog.txt and pom.xml in the zip -->
        <fileSet>
            <directory></directory>
            <filtered>false</filtered>
            <useStrictFiltering>true</useStrictFiltering>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>changelog.txt</include>
                <include>readme.txt</include>
                <include>pom.xml</include>
            </includes>
        </fileSet>

        <!-- include provided documentation in the zip -->
        <fileSet>
            <directory>doc</directory>
            <filtered>false</filtered>
            <useStrictFiltering>true</useStrictFiltering>
            <outputDirectory>doc</outputDirectory>
        </fileSet>

        <!-- include provided documentation in the zip -->
        <fileSet>
            <directory>target/apidocs</directory>
            <filtered>false</filtered>
            <outputDirectory>doc/apidocs</outputDirectory>
        </fileSet>

        <!-- include compiled WCB in the zip -->
        <fileSet>
            <directory>target</directory>
            <filtered>false</filtered>
            <outputDirectory>bin</outputDirectory>
            <includes>
                <include>${pom.artifactId}-${pom.version}.jar</include>
            </includes>
        </fileSet>

        <!-- include the sources in the zip -->
        <fileSet>
            <directory>src</directory>
            <filtered>false</filtered>
            <useStrictFiltering>true</useStrictFiltering>
            <outputDirectory>src</outputDirectory>
        </fileSet>

    </fileSets>
</assembly>

Be sure to add files "readme.txt" and "changelog.txt" (templates are here) to your directories.

Build as usual ("mvn -s C:\GX\WebManager9\settings.xml clean package"). The WCA .zip file will appear in the target directory.

Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators