---
title: "Task publish"
source: https://dev.pageseeder.com/guide/publishing/ant_api/tasks/task_publish.html
description: "The Task publish allows remote invocation of ANT scripts on a PageSeeder server. It supports document and project publishing with configurable parameters, logging levels, and error handling."
last_updated: 2026-09-08T13:59:56+10:00
tokens: ~825
---

# Task publish

This task lets the Ant Script remotely invoke ANT scripts on a PageSeeder server.

> **Note:** This task is available in PageSeeder v5.8900 and higher.

## Definition

```xml

<ps:publish
    group="[full groupname]"
    uri="[uri ID]"
    documenttype="[PSML document type]"
    project="[project containing script]"
    type=" [import|export|publish|process|preview]"
    target="[target name]"
    loglevel="[info|verbose|warn|error|debug]"
    failonerror="[true|false]"
    pollinginterval="[milliseconds]"
    config="[config name]">
  <parameter name="[param name]" value="[param value]"/>
  ... 
</ps:publish>
```

 

## Attributes

| **Attribute** | Description | Required | Default |
| --- | --- | --- | --- |
| **group** | The full name of the group to publish | Yes |  |
| **uri** | The URI ID of the document to publish (document publish scripts only) | No |  |
| **documenttype** | The document type of the document to publish (document publish scripts only) | No |  |
| **project** | The project containing the ANT script | Yes |  |
| **type** | The publish action type `[export\|publish\|process]` | Yes |  |
| **target** | The target name in the script | Yes |  |
| **loglevel** | The level of logging the script should output `[info\|verbose\|warn\|error\|debug]` | No | `info` |
| **failonerror** | If `true`, stop ANT build script on error | No | `true` |
| **pollinginterval** | The number of milliseconds between each check to see if the upload is complete | No | `5000` |
| **config** | Universal PS config name | No | `default` |

## Elements

Elements are not required but can be used to set more options.

### Element \<parameter\>

If specified, passes one or more parameter values to the ANT script.

| **Attribute** | Description | Required |
| --- | --- | --- |
| **name** | The name of the parameter | Yes |
| **value** | The value of the parameter | Yes |

Parameter values can be used in the ANT script using `${ps.param.[name]}` after calling the `<ps:config />` task.

## Environment

This task uses the following PS config environment properties:

- **scheme** – scheme for connecting to PageSeeder.
- **host** – host for connecting to PageSeeder.
- **port** – port for connecting to PageSeeder.
- **site.prefix** – site prefix for connecting to PageSeeder – default  /ps.
- **username** – username of member for publish
- **user.token** or **jsessionid** or **password** – access token or jsessionid or  username’s password for connecting to PageSeeder.

## Errors

Possible errors are:

- **Error connecting to the Pageseeder server** – if scheme, host or port are incorrect.
- **Failed to publish** – Invalid HTTP Status: 401 – if username or password are incorrect.
- **Failed to publish** – Invalid HTTP Status: 403 – if group doesn’t exist or user doesn’t have access to it.
- An error occurred while running the Ant script.

## Examples

```xml
<ps:config file="pageseeder.properties"/>

<ps:publish group="acme-demo"
            project="acme"
            type="publish"
            target="my-publish">
    <parameter name="index" value="true"/>
</ps:publish>
```

In `pageseeder.properties` file:

```properties
scheme=https
host=ps.acme.com
port=443
site.prefix=/ps
client.id=87ff810b199f0636
client.secret=8G8gVEjxcGbWKLuCEYErxg
```

