RPM Systemd Maven Plugin

This plugin can be used to generate files for RPM packages and systemd services

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

de.douglas.maven.plugin
Идентификатор

Идентификатор

rpm-systemd-maven-plugin
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

RPM Systemd Maven Plugin
This plugin can be used to generate files for RPM packages and systemd services
Ссылка на сайт

Ссылка на сайт

https://github.com/dglecom/rpm-systemd-maven-plugin
Система контроля версий

Система контроля версий

https://github.com/dglecom/rpm-systemd-maven-plugin

Скачать rpm-systemd-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>de.douglas.maven.plugin</groupId>
    <artifactId>rpm-systemd-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.3.9
org.scala-lang : scala-library jar 2.11.8

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (5)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
org.apache.maven : maven-core jar 3.3.9
org.apache.maven : maven-compat jar 3.3.9
commons-io : commons-io jar 2.4

Модули Проекта

Данный проект не имеет модулей.

RPM Systemd Maven Plugin

This plugin can be used to generate files for RPM packages and systemd services.

Build Status Maven Central

Usage

The plugin currently supports two goals:

  • generate-systemd-file: This generates a systemd file for the module
  • generate-rpm-postinst-file: This generates a postinst file to set up the target system
<plugin>
    <groupId>de.douglas.maven.plugin</groupId>
    <artifactId>rpm-systemd-maven-plugin</artifactId>
    <version>1.0</version>
    <executions>
        <execution>
            <phase>generate-resources</phase>
            <goals>
                <goal>generate-systemd-file</goal>
                <goal>generate-rpm-install-files</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Usage in conjunction with the RPM Maven Plugin

This plugin can be used in conjunction with the RPM Maven Plugin to create a RPM package including the systemd and postinst file.

<plugins>
    <plugin>
        <groupId>de.douglas.maven.plugin</groupId>
        <artifactId>rpm-systemd-maven-plugin</artifactId>
        <executions>
            <execution>
                <phase>generate-resources</phase>
                <goals>
                    <goal>generate-systemd-file</goal>
                    <goal>generate-rpm-postinst-file</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rpm-maven-plugin</artifactId>
        <configuration>
            <mappings>
                <mapping>
                    <directory>/usr/lib/systemd/system</directory>
                    <sources>
                        <source>
                            <location>${project.build.directory}/rpm-systemd-maven-plugin/${project.artifactId}.service</location>
                        </source>
                    </sources>
                    <directoryIncluded>false</directoryIncluded>
                    <configuration>false</configuration>
                </mapping>
            </mappings>
            <postinstallScriptlet>
                <scriptFile>target/rpm-systemd-maven-plugin/postinst</scriptFile>
                <fileEncoding>utf-8</fileEncoding>
            </postinstallScriptlet>
            ...
        </configuration>
    </plugin>
</plugins>

Override variables

You can override the following variables in the plugin configuration:

javaPath

  • Path to the java binary in the systemd service file
  • Defaults to /usr/bin/java

runnableJarPath

  • Path to the runnable jar of the module in the systemd service file
  • Defaults to /usr/share/${project.artifactId}/${project.build.finalName}.${project.packaging}

workingDirectoryPath

  • Path to the working directory in the systemd service file
  • Used as home directory for the user the module will be executed with
  • Defaults to /var/lib/${project.artifactId}

environmentFilePath

  • Path to the environment file in the systemd service file
  • Created in the postinst file
  • Defaults to /etc/sysconfig/${project.artifactId}

systemdServiceFileName

  • Name of the systemd service file
  • Used in the postinst file to preset the systemd service
  • Defaults to ${project.artifactId}.service

user

  • User to be used for module execution in the systemd service file
  • Used to set permissions for directories
  • Defaults to ${project.artifactId}

group

  • Group to be used for module execution in the systemd service file
  • Used to set permissions for directories
  • Defaults to ${project.artifactId}

additionalDirectories

  • List of additional directories to be created in the postinst file
  • Defaults to an empty list

Example

To override the runnableJarPath and add additional directories, use

<plugins>
    <plugin>
        <groupId>de.douglas.maven.plugin</groupId>
        <artifactId>rpm-systemd-maven-plugin</artifactId>
        <configuration>
            <runnableJarPath>/opt/${project.artifactId}/${project.build.finalName}-jarlotte.jar</runnableJarPath>
            <additionalDirectories>
                <additionalDirectory>
                    <directory>/etc/${project.artifactId}</directory>
                    <user>root</user>
                    <group>root</group>
                </additionalDirectory>
                <additionalDirectory>
                    <directory>/var/log/${project.artifactId}</directory>
                    <user>${project.artifactId}</user>
                    <group>${project.artifactId}</group>
                </additionalDirectory>
            </additionalDirectories>
        </configuration>
        ...
    </plugin>
</plugins>

or

<properties>
    <runnableJarPath>/opt/${project.artifactId}/${project.build.finalName}-jarlotte.jar</runnableJarPath>
</properties>

License

The RPM Systemd Maven Plugin is released under version 2.0 of the Apache License.

de.douglas.maven.plugin

Parfümerie Douglas GmbH

Версии библиотеки

Версия
1.0