How do I deploy a site?
Author: Deron Eriksson
Description: This tutorial describes how to deploy a documentation site.
Tutorial created using:
Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)
(Continued from page 1) To configure a mavenSW project for a "site-deploy", you need a site section in your distributionManagement section of your pom.xml. I created a simple project called "aproject" and added this to its pom.xml. Since I'm going to deploy to ApacheSW running Webdav using the dav protocol, I need to include a "wagon-webdav" build extension. pom.xml<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.maventest</groupId> <artifactId>aproject</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <name>aproject</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-webdav</artifactId> <version>1.0-beta-2</version> </extension> </extensions> </build> <distributionManagement> <site> <id>site.deployments</id> <name>Site deployments</name> <url>dav:http://192.168.1.7/sites/${project.artifactId}/</url> </site> </distributionManagement> </project> I added a server entry with a name and password for the "site.deployments" server id to my settings.xml: settings.xml server entry<server> <id>site.deployments</id> <username>admin</username> <password>admin1</password> </server> Now, I'll perform a "mvn clean site-deploy". I selected the "aproject" project and selected the "mvn clean site-deploy" external tool configuration. This generates the following console output: Console output from 'mvn clean site-deploy' on 'aproject'[INFO] Scanning for projects... WAGON_VERSION: 1.0-beta-2 [INFO] ------------------------------------------------------------------------ [INFO] Building aproject [INFO] task-segment: [clean, site-deploy] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean] [INFO] Deleting directory C:\dev\workspace\aproject\target [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [site:site] [INFO] Generating "Continuous Integration" report. [INFO] Generating "Dependencies" report. [INFO] Generating "Issue Tracking" report. [INFO] Generating "Project License" report. [INFO] Generating "Mailing Lists" report. [INFO] Generating "About" report. [INFO] Generating "Project Summary" report. [INFO] Generating "Source Repository" report. [INFO] Generating "Project Team" report. [INFO] [site:deploy] http://192.168.1.7/sites/aproject/ - Session: Opened Uploading: ./css/maven-base.css to http://192.168.1.7/sites/aproject/ # Transfer finished. 2371 bytes copied in 0.015 seconds Uploading: ./css/maven-theme.css to http://192.168.1.7/sites/aproject/ # Transfer finished. 2801 bytes copied in 0.0090 seconds Uploading: ./css/print.css to http://192.168.1.7/sites/aproject/ # Transfer finished. 222 bytes copied in 0.011 seconds Uploading: ./css/site.css to http://192.168.1.7/sites/aproject/ Transfer finished. 0 bytes copied in 0.0060 seconds Uploading: ./dependencies.html to http://192.168.1.7/sites/aproject/ ## Transfer finished. 5175 bytes copied in 0.017 seconds Uploading: ./images/collapsed.gif to http://192.168.1.7/sites/aproject/ # Transfer finished. 53 bytes copied in 0.01 seconds Uploading: ./images/expanded.gif to http://192.168.1.7/sites/aproject/ # Transfer finished. 52 bytes copied in 0.016 seconds Uploading: ./images/external.png to http://192.168.1.7/sites/aproject/ # Transfer finished. 230 bytes copied in 0.0090 seconds Uploading: ./images/icon_error_sml.gif to http://192.168.1.7/sites/aproject/ # Transfer finished. 1010 bytes copied in 0.012 seconds Uploading: ./images/icon_info_sml.gif to http://192.168.1.7/sites/aproject/ # Transfer finished. 606 bytes copied in 0.0090 seconds Uploading: ./images/icon_success_sml.gif to http://192.168.1.7/sites/aproject/ # Transfer finished. 990 bytes copied in 0.01 seconds Uploading: ./images/icon_warning_sml.gif to http://192.168.1.7/sites/aproject/ # Transfer finished. 576 bytes copied in 0.0090 seconds Uploading: ./images/logos/build-by-maven-black.png to http://192.168.1.7/sites/aproject/ # Transfer finished. 2294 bytes copied in 0.01 seconds Uploading: ./images/logos/build-by-maven-white.png to http://192.168.1.7/sites/aproject/ # Transfer finished. 2260 bytes copied in 0.011 seconds Uploading: ./images/logos/maven-feather.png to http://192.168.1.7/sites/aproject/ # Transfer finished. 3330 bytes copied in 0.01 seconds Uploading: ./images/newwindow.png to http://192.168.1.7/sites/aproject/ # Transfer finished. 220 bytes copied in 0.01 seconds Uploading: ./index.html to http://192.168.1.7/sites/aproject/ # Transfer finished. 3733 bytes copied in 0.011 seconds Uploading: ./integration.html to http://192.168.1.7/sites/aproject/ # Transfer finished. 3779 bytes copied in 0.015 seconds Uploading: ./issue-tracking.html to http://192.168.1.7/sites/aproject/ # Transfer finished. 3743 bytes copied in 0.011 seconds Uploading: ./license.html to http://192.168.1.7/sites/aproject/ # Transfer finished. 3726 bytes copied in 0.019 seconds Uploading: ./mail-lists.html to http://192.168.1.7/sites/aproject/ # Transfer finished. 3754 bytes copied in 0.012 seconds Uploading: ./project-info.html to http://192.168.1.7/sites/aproject/ ## Transfer finished. 5771 bytes copied in 0.017 seconds Uploading: ./project-summary.html to http://192.168.1.7/sites/aproject/ ## Transfer finished. 4552 bytes copied in 0.014 seconds Uploading: ./source-repository.html to http://192.168.1.7/sites/aproject/ # Transfer finished. 3761 bytes copied in 0.012 seconds Uploading: ./team-list.html to http://192.168.1.7/sites/aproject/ ## Transfer finished. 4894 bytes copied in 0.016 seconds http://192.168.1.7/sites/aproject/ - Session: Disconnecting http://192.168.1.7/sites/aproject/ - Session: Disconnected [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7 seconds [INFO] Finished at: Thu Feb 14 12:46:27 PST 2008 [INFO] Final Memory: 13M/27M [INFO] ------------------------------------------------------------------------ We can try hitting the "aproject" site that we just deployed to the Apache server via Webdav. We can see that the documentation site has indeed been successfully deployed. Related Tutorials:
|