Skip to content

nodevops/confd-maven-plugin

Repository files navigation

Confd Maven Plugin

Badges

Linux Build Status Windows Build Status Code Coverage Dependency Status

What?

The confd maven plugin aims at integrating confd, a lightweight configuration management tool, with maven.

Because we use extensively confd to deal with our environment dependant application configuration files (in a docker data-container for instance), and because we want to use the same tool everywhere, starting with the developer workstation, we needed to be able to use confd templates and configuration files inside a maven build.

The confd-maven-plugin hence allows you to use confd templates inside your project (instead of using the classical filtering features provided by default by Maven)

Note: because confd is currently not available for the Windows operating system, we provide a workaround in the form of a (very) basic java implementation of confd (only for the env backend) that only supports the getv template function like in the {{getv "/myapp/database/url"}} example.

The documentation of the plugin is available at http://nodevops.github.io/confd-maven-plugin/

Building

The confd-maven-plugin is built against jdk 7 and maven 3.1.1

Unit tests

  • under linux: you need confd installed somewhere

    • the default expected location is /usr/local/bin/confd

    • you can override the location using the switch -Dconfd.local.path.for.tests=/opt/local/confd-0.11.0/confd

  • under windows: the tests requiring a confd binary are skipped

Integration testing

you need docker to run the integration tests:

  • cd in the project root directory

  • we currently expect that your user id is 1000

  • mvn install at least one time so that the plugin artifacts are stored in your maven cache

  • launch:

    • bash docker run -ti --rm -v $(pwd):/test -v $HOME/.m2:/test/.m2 -e JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk nodevops/maven-fury-confd:1.0 /opt/local/maven-3.1.x/bin/mvn clean verify -P integration-test

    • fish docker run -ti --rm -v (pwd):/test -v $HOME/.m2:/test/.m2 -e JAVA_HOME=/usr/lib/jvm/java-1.7-openjdk nodevops/maven-fury-confd:1.0 /opt/local/maven-3.1.x/bin/mvn clean verify -P integration-test

  • be patient because a lot of maven builds are involved in these integration tests

Contribute

Feedbacks and contributions are welcome through issues and pull requests

Licence

Copyright 2015 NoDevOps

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.