Brooklyn Maven Plugin

A Maven plugin to help test Apache Brooklyn blueprints.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

io.brooklyn.maven
ArtifactId

ArtifactId

brooklyn-maven-plugin
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Brooklyn Maven Plugin
A Maven plugin to help test Apache Brooklyn blueprints.
Project URL

Project URL

https://github.com/brooklyncentral/brooklyn-maven-plugin
Source Code Management

Source Code Management

https://github.com/brooklyncentral/brooklyn-maven-plugin

Download brooklyn-maven-plugin

How to add to project

<plugin>
    <groupId>io.brooklyn.maven</groupId>
    <artifactId>brooklyn-maven-plugin</artifactId>
    <version>0.3.0</version>
</plugin>

Dependencies

compile (7)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.2.5
org.apache.maven : maven-core jar 3.2.5
org.apache.maven.shared : maven-shared-utils jar 0.9
org.twdata.maven : mojo-executor jar 2.2.0
org.apache.brooklyn : brooklyn-api jar 0.9.0
org.apache.brooklyn : brooklyn-rest-client jar 0.9.0
org.apache.brooklyn : brooklyn-utils-common jar 0.9.0

provided (2)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.3
com.google.auto.value : auto-value jar 1.1

test (4)

Group / Artifact Type Version
junit : junit jar 4.12
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.2.0
com.squareup.okhttp : mockwebserver jar 2.1.0
org.apache.maven.shared : maven-verifier jar 1.5

Project Modules

There are no modules declared in this project.

Brooklyn Maven Plugin

A Maven plugin to help test Apache Brooklyn blueprints. For full documentation see [the plugin website] (http://brooklyncentral.github.io/brooklyn-maven-plugin/index.html).

Download

Include this plugin in your pom:

<plugin>
    <groupId>io.brooklyn.maven</groupId>
    <artifactId>brooklyn-maven-plugin</artifactId>
    <version>${latestPluginVersion}</version>
</plugin>

Goals

start-server
Run a Brooklyn server.
deploy
Instruct an existing Brooklyn server to deploy the given blueprint.
sensor
Fetch the value of a sensor on entities at a given server whose types match a regular expression.
stop
Instruct a Brooklyn server to stop the application with the given ID.
stop-server
Instruct a Brooklyn server to shut down
help
Display help information on brooklyn-maven-plugin.

Example

The example-pom project:

  • Deploys a blueprint from a file that runs a TomcatServer and an EmptySoftwareProcess.
  • Queries Brooklyn for the main URL of the Tomcat application (the webapp.url sensor).
  • Uses maven-antrun-plugin to echo these values to the console.
  • Stops the deployment before Maven exits.

The important bits of the pom are:

<plugin>
    <groupId>io.brooklyn.maven</groupId>
    <artifactId>brooklyn-maven-plugin</artifactId>
    <version>0.3.0</version>
    <executions>
        <execution>
            <id>Run Brooklyn</id>
            <goals>
                <goal>start-sever</goal>
                <goal>deploy</goal>
                <goal>sensor</goal>
                <goal>stop</goal>
                <goal>stop-server</goal>
            </goals>
            <configuration>
                <blueprint>${project.basedir}/blueprint.yaml</blueprint>
                <sensor>webapp.url</sensor>
                <typeRegex>.*Tomcat.*</typeRegex>
            </configuration>
        </execution>
    </executions>
</plugin>

You can test this project by starting Brooklyn and running mvn clean install from the example-app directory.

At the end of the build you should see output like:

[INFO] --- maven-antrun-plugin:1.3:run (default) @ test ---
[INFO] Executing tasks
    [echo] Maven plugin example results:
    [echo] Server was running at http://127.0.01:8081
    [echo] Application: T0tERELL
    [echo] Sensor value: http://127.0.0.1:8080/

The plugin writes a logback.xml file to target/brooklyn-maven-plugin/conf/ and puts it on the server's classpath. Server logs (brooklyn.debug.log and brooklyn.info.log) are written to target/brooklyn-maven-plugin/.

io.brooklyn.maven

Brooklyn Central

A community hub for Apache Brooklyn

Versions

Version
0.3.0
0.2.0
0.1.0