ACE Maven Plugin

This plugin imports content files into ACE.

Requirements

The ACE Maven Plugin requires Maven 3.6.3 or higher

Overview

By default it imports all importable files in src/main/content. A different location can be configured in the pom.xml file or with properties from the command line.

Importable files

By default the importer will try to import all of the following file types.

JSON, YML and JAR files will be imported as-is into the ACE system, but the rest of the files types mentioned are instead used to generate content JSON to be imported.

This list can be overridden by the configuration parameter fileset as well as the command line properties -Dace.import.includes and -Dace.import.excludes.

File Type Explanation Generates content with alias
*.json Content files in JSON format N/A
*.yml Content files in YAML format N/A
*.jar Several content files bundled into a JAR archive N/A
<X>.composer.js A JavaScript composer definition _config/X
<X>.mapper.js A JavaScript mapper definition _config/X
<X>.prestore.js A JavaScript pre-store hook definition _config/X
<X>.predelete.js A JavaScript pre-delete hook definition _config/X
<X>.onconflict.js A JavaScript on-conflict hook definition _config/X
<X>.contentType An ACE content type definition _type/X
<X>.template.json An ACE UI presentation template _template/X
<X>.domainObject.js An ACE UI domain object _domainObject/X
<X>.workflow An ACE workflow definition _workflow/X

Usage

pom.xml

<build>
  <plugins>
    <plugin>
      <groupId>com.atex.plugins</groupId>
      <artifactId>ace-maven-plugin</artifactId>
      <configuration>
        <filesets>
          <fileset>
            <directory>src/main/othercontent</directory>
            <includes>
              <include>**/*.json</include>
            </includes>
            <excludes>
              <exclude>**/foo.json</exclude>
              <exclude>**/bar.json</exclude>
            </excludes>
          </fileset>
        </filesets>
        <url>http://ace-content-service:8081/</url>
        <fileUrl>http://ace-file-service:8082/</fileUrl>
        <username>admin</username>
        <password>123456</password>
        <dryRun>false</dryRun>
      </configuration>
    </plugin>
  </plugins>
</build>
Configuration parameters
Fileset (optional)

The fileset specifies which files from which directory will be imported. The given directory is interpreted from the module root if it is not an absolute path. includes and excludes describe patterns for file inclusion and exclusion respectively.

By default all importable files located in src/main/content will be imported.

URL (optional)

The absolute URL to the ACE importer service. Default: http://localhost:8081/

Username (optional)

The username used to access the ACE importer service. Default: admin

Password (optional)

The password used to access the ACE importer service. Default: 12345

Dry run (optional)

If set to <dryRun>true</dryRun> no content will be imported. All files that would have been imported will get listed in the log instead. This is especially useful while testing configurations and scripts.

Force (optional)

If set to <force>true</force>, checksum checking will be disabled, meaning that no content will be skipped during import.

Verbose (optional)

If set to <verbose>true</verbose>, more detailed information (such as include patterns, skipped content, etc) will be displayed during import.

Command line

The ACE importer plugin can be run from the command line by running mvn ace:import. It will by default import all importable files located in every src/main/content folder of the current module and its submodules.

Note:

For this shorthand to work, you will have to add the ace-public Maven repository, and the com.atex.plugins pluginGroup to your settings.xml.

    <servers>
        ...
        <server>
            <id>ace-public</id>
            <username>...</username>
            <password>...</password>
        </server>
    </servers>
    ...

    <pluginGroups>
        ...
        <pluginGroup>com.atex.plugins</pluginGroup>
    </pluginGroups>
Configuration parameters

The ACE importer plugin may be configured with the following properties (-D).

-Dace.import.path

If set to a directory the importer only looks for files to import in said directory. The inclusion and exclusion patterns apply! If the given directory is not an absolute path then it is considered to be relative to the project.base.dir.

Example: -Dace.import.path=/tmp/imports imports files from the folder /tmp/imports (and subfolders if the inclusion patterns allow it).

If set to a file the importer imports only said file (ignoring inclusion and exclusion patterns altogether).

Example: -Dace.import.path=/tmp/imports/hejho.json imports only the file /tmp/imports/hejho.json.

Note: If run from the ace root, the importer will be executed for each module specified in the pom (as other maven mojos), this will by default import from ./content in every module. When using an absolute path run the importer from where no submodules exist to avoid multiple imports.

Example:

cd content
mvn ace:import -Dace.import.path=/Users/your_name/ace/content/src/main/content/types/atexCategorization.json
-Dace.import.includes

A list of file inclusion patterns.

Example: -Dace.import.includes=**/*.json imports all *.json files from all subdirectories.

-Dace.import.excludes

A list of file exclusion patterns.

Example: -Dace.import.excludes=foo/bar.json excludes the file bar.json located in the subdirectory foo.

-Dace.import.url

The absolute URL to the ACE importer service.

Default: http://localhost:8081/

-Dace.import.username

The username used to access the ACE importer service.

Default: admin

-Dace.import.password

The password used to access the ACE importer service.

Default: 12345

-Dace.import.dryrun

When run with -Dace.import.dryrun=true the importer will not actually import anything but just list all the files it would have imported. This is especially useful while testing configurations and scripts.

-Dace.import.force

When run with -Dace.import.force all no imports will be skipped, even if the checksum for the content is unchanged.

-Dace.import.verbose

Use -Dace.import.verbose to display more information when importing, such as include patterns, skipped content etc. This is the same as the previous behavior before this parameter was introduced.