This plugin adds the ability to create a Skipper package as part of the Maven build process.
It contains templates
for the common package files and uses the Maven project values to populate much of the template properties
(project.artifactId
, project.version
, etc.). It also provides the ability to override any of these template
files in the project if you need to tweak or add properties.
See this blog post for more context:
https://blog.switchbit.io/spring-cloud-skipper-as-a-service-broker
The default templates are located at src/main/resources/skipper
.
src/main/resources/skipper $ tree
├── package.yml
├── templates
│ └── template.yml
└── values.yml
The Spring Cloud Skipper Maven Plugin has the following goals.
- skipper-package creates a Spring Cloud Skipper compliant package
- skipper-upload uploads Spring Cloud Skipper package to a Skipper repository
<build>
<plugins>
...
<plugin>
<groupId>io.switchbit</groupId>
<artifactId>spring-cloud-skipper-maven-plugin</artifactId>
<version>0.1.0.BUILD-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>skipper-package</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
The configuration above will create the Skipper package on the package
phase.
In short it will copy the template package files into your build directory, overwrite any templates
in the current project, allowing you to override templates when you need too and then filter
the templates, replacing the respective values with their project POM values. Once that's done it zip's them all
up into a Skipper package.
This uploads the Skipper package built with the skipper-package
goal to the repository specified (default: local
).
See the below attributes to customise which Skipper server to target etc.
- Requires a Maven project to be executed.
- Binds by default to the lifecycle phase:
package
.
Name | Type | Description | Default |
---|---|---|---|
overrideDirectory |
String |
The directory where template files that will override the default tempaltes are located. | ${project.build.directory}/classes/META-INF/skipper |
skipper.workDir |
String |
The directory where the template files will be copied too during packaging | ${project.build.directory}/skipper |
skipper.server.uri |
String |
The URI of the Skipper server to target | http://localhost:7577/api |
skipper.repo.name |
String |
The repository to upload the Skipper package too | local |
The Fabric8 Maven plugin was a great reference when creating this plugin. Specifically how to load and process resources.