Code Monkey home page Code Monkey logo

aws-p2-maven-plugin's Introduction

AWS p2 Maven Plugin (aws-p2-maven-plugin)

Build Status Coverage Status Codacy Badge License Maven Central

A Maven plugin for deploying a p2 update site to an AWS S3 bucket.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Java 1.7+

Maven 3.1.0+

Installation

To build the plugin locally, simply run the following:

$ mvn clean install

Usage

The aws-p2-maven-plugin is available from Maven Central.

Add the plugin to the build section of the pom.xml:

<plugin>
    <groupId>com.avojak.mojo</groupId>
    <artifactId>aws-p2-maven-plugin</artifactId>
    <version>1.0</version>
    <configuration>
        <bucket>p2.example.com</bucket>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The plugin will run automatically during the deploy phase.

Additionally, you may add a pluginGroup entry to the Maven settings file (User: ${user.home}/.m2/settings.xml, Global: ${maven.home}/conf/settings.xml), which will allow the use of aws-p2:* command line goals interactively in all projects:

<pluginGroups>
    <pluginGroup>com.avojak.mojo</pluginGroup>
</pluginGroups>

For example, $ mvn aws-p2:deploy -Daws-p2.bucket=p2.example.com.

Goals

The following goals are available:

Goal Description
deploy Deploys the p2 update site
help Display help information on the aws-p2-maven-plugin

Configuration

The following parameters can be set in the configuration:

Name Type Required Since Description
bucket String Yes 1.0 The name of the S3 bucket where the update site is hosted.
User property is: aws-p2.bucket
deploySnapshots boolean No 1.0 Whether or not to deploy snapshot versions.
Default value is: true
User property is: aws-p2.deploySnapshots
generateLandingPage boolean No 1.0 Whether or not to generate an HTML landing page. This page will be displayed if a user attempts to access the update site via a web browser. No external sources are used in this page, so CORS configuration is not necessary. An example landing page can be found here: p2.avojak.com
Default value is: false
User property is: aws-p2.generateLandingPage
projectName String No 2.0 The project name that will dictate the root directory of the repository.
Default value is: ${project.name}
User property is: aws-p2.projectName
skip boolean No 1.0 Set to true to skip plugin execution.
Default value is: false
User property is: aws-p2.skip
targetSiteDirectory String No 1.0 The directory within the bucket to place the update site.
Default value is: ${project.name}/${project.version}
User property is: aws-p2.targetSiteDirectory

Authentication

The AWS p2 Maven Plugin uses the Default Credential Provider Chain for authentication. See Working with AWS Credentials for details on all supported methods of providing credentials.

S3 Bucket Configuration

In order to host a static p2 update site on an S3 bucket, you will need to ensure several bucket settings:

  1. In the bucket properties tab, "Static website hosting" must be enabled
  2. In the bucket permissions tab, "Public access" to list bucket contents must be enabled

It is up to the consumer to configure the AWS account used for deployments, although we recommend creating an account whose sole responsibility is deploying to this bucket. Only the minimum required permissions should be granted to this user.

If versioning is enabled on the bucket, not all versions are deleted during an overwrite. When a new site is uploaded, only current content is deleted, and delete markers are not touched.

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

More Information

For more information on the development, check out my blog post.

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details

aws-p2-maven-plugin's People

Contributors

avojak avatar snyk-bot avatar

Watchers

 avatar  avatar  avatar

Forkers

limwt

aws-p2-maven-plugin's Issues

Add prefix info to README

Add info about the plugin prefix to the README.

<pluginGroups>
  <pluginGroup>com.avojak.mojo</pluginGroup>
</pluginGroups>

Added to the Maven settings file (User: ${user.home}/.m2/settings.xml, Global: ${maven.home}/conf/settings.xml). Allows the use of aws-p2:* command line goals interactively in all projects.

Add more detail for usage

Add more detail to the usage section. Include sample Maven commands to invoke the plugin.

eg. mvn deploy com.avojak.mojo:aws-p2-maven-plugin:1.0:deploy -Daws-p2.bucket=p2.example.com to explicitly invoke or mvn deploy to automatically use configuration in pom.xml.

Change URL S3 Key Structure

Update the structure of the keys to be:

{project_name}/{snapshots|releases}/{version}/{filename}

This would also eliminate the need for separate buckets for snapshots/releases.

Support endpoint for latest version

Add support for retrieving the latest content instead of specifying a specific version.

For example:
http://p2.example.com/snapshot/example-eclipse-plugin.site/latest
should be equivalent to
http://p2.example.com/snapshot/example-eclipse-plugin.site/1.0.0-SNAPSHOT
if the latest version deployed is 1.0.0-SNAPSHOT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.