Search in sources :

Example 1 with MojoInject

use of com.itemis.maven.plugins.cdi.annotations.MojoInject in project unleash-maven-plugin by shillner.

the class AbstractUnleashMojo method getReleaseArgs.

@MojoProduces
@Named("releaseArgs")
@MojoInject
private Properties getReleaseArgs(Log log) {
    Properties args = new Properties();
    Splitter splitter = Splitter.on('=');
    for (String arg : this.releaseArgs) {
        List<String> split = splitter.splitToList(arg);
        if (split.size() == 2) {
            args.put(split.get(0), split.get(1));
        } else {
            log.warn("Could not set '" + arg + "' as a Property for the Maven release build.");
        }
    }
    // Add default property indicating that the unleash plugin is triggering the build
    args.put("isUnleashBuild", "true");
    return args;
}
Also used : Splitter(com.google.common.base.Splitter) Properties(java.util.Properties) Named(javax.inject.Named) MojoProduces(com.itemis.maven.plugins.cdi.annotations.MojoProduces) MojoInject(com.itemis.maven.plugins.cdi.annotations.MojoInject)

Aggregations

Splitter (com.google.common.base.Splitter)1 MojoInject (com.itemis.maven.plugins.cdi.annotations.MojoInject)1 MojoProduces (com.itemis.maven.plugins.cdi.annotations.MojoProduces)1 Properties (java.util.Properties)1 Named (javax.inject.Named)1