com.deviceinsight.azure:azure-blob-upload-maven-plugin

A Maven Plugin for Publishing Files to Azure Blob Storage


Keywords
azure, azure-storage, azure-storage-blob, maven, maven-plugin
License
Apache-2.0

Documentation

General

Use this Maven plugin to recursivly upload the contents of a directory to an Azure blob storage container. This is for example useful if you use the "Static website" feature for serving web resources.

Usage

This plugin is available on Maven Central.

Using it interactively:

mvn com.deviceinsight.azure:azure-blob-upload-maven-plugin:2.0.0:upload \
    -DconnectionString='DefaultEndpointsProtocol=https;AccountName=test;AccountKey=xxx;EndpointSuffix=core.windows.net' \
    -DcontainerName=testcontainer \
    -DrootDir=/tmp/contents

rootDir is the local directory you want to upload. connectionString is the Azure connection string. containerName is the container in the storage acount that you want to upload into.

Using it in your pom.xml:

<dependency>
    <groupId>com.deviceinsight</groupId>
    <artifactId>azure-blob-upload-maven-plugin</artifactId>
    <version>2.0.0</version>
</dependency>
<build>
  <plugins>
    ...
    <plugin>
      <groupId>com.deviceinsight.azure</groupId>
      <artifactId>azure-blob-upload-maven-plugin</artifactId>
      <version>2.0.0</version>
      <executions>
        <execution>
          <id>upload</id>
          <phase>deploy</phase>
          <goals>
            <goal>upload</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <connectionString>DefaultEndpointsProtocol=https;AccountName=someaccountname;AccountKey=somekey;EndpointSuffix=core.windows.net</connectionString>
        <rootDir>somedir</rootDir>
        <containerName>somecontainer</containerName>
      </configuration>
    </plugin>
  </plugins>
</build>

Excluding files from upload:

<configuration>
  <excludes>
    <exclude>extensions/**/*</exclude>
    <exclude>**/*.json</exclude>
  </excludes>
</configuration>

Only including certain files also works:

<configuration>
  <includes>
    <include>**/*.html</include>
  </includes>
</configuration>

Releasing

The plugin can be released using:

mvn deploy -Prelease