-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for extensions and RPM primary packaging * Added test case for primary packaging * Update tests * update license block * Added secondary example apt.vm file showing the necessary configurations for primary-artifact generation
- Loading branch information
Showing
5 changed files
with
305 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>de.dentrassi.maven.rpm.test</groupId> | ||
<artifactId>test14-primaryname</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>rpm</packaging> | ||
|
||
<name>Test Package #14</name> | ||
<description> | ||
Test primary name | ||
</description> | ||
|
||
<url>http://dentrassi.de</url> | ||
|
||
<organization> | ||
<name>Jens Reimann</name> | ||
<url>http://dentrassi.de</url> | ||
</organization> | ||
|
||
<licenses> | ||
<license> | ||
<name>Eclipse Public License - v 1.0</name> | ||
<distribution>repo</distribution> | ||
<url>https://www.eclipse.org/legal/epl-v10.html</url> | ||
</license> | ||
</licenses> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<skipSigning>true</skipSigning> | ||
<rpm.skipSigning>true</rpm.skipSigning> | ||
</properties> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>de.dentrassi.maven</groupId> | ||
<artifactId>rpm</artifactId> | ||
<extensions>true</extensions> | ||
<version>@project.version@</version> | ||
<executions> | ||
<execution> | ||
<configuration> | ||
<group>Application/Misc</group> | ||
|
||
<forceRelease>false</forceRelease> | ||
<version>1.0.0</version> | ||
|
||
<signature> | ||
<keyId>${keyId}</keyId> | ||
<keyringFile>${user.home}/.gnupg/secring.gpg</keyringFile> | ||
<passphrase>${passphrase}</passphrase> | ||
<hashAlgorithm>SHA1</hashAlgorithm> | ||
<skip>${skipSigning}</skip> | ||
</signature> | ||
|
||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>sign</id> | ||
<activation> | ||
<activeByDefault>false</activeByDefault> | ||
</activation> | ||
<properties> | ||
<skipSigning>false</skipSigning> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import java.io.File | ||
|
||
myfile=null | ||
basedir.eachDirRecurse{dir -> | ||
dir.eachFileMatch(~/.*test14-primaryname-1.0.0-0.\d+.noarch.rpm.*/) { file -> | ||
myfile=file | ||
} | ||
} | ||
|
||
myfile != null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<component-set> | ||
<components> | ||
<component> | ||
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> | ||
<role-hint>rpm</role-hint> | ||
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> | ||
<instantiation-strategy>per-lookup</instantiation-strategy> | ||
<configuration> | ||
<phases> | ||
<process-resources>org.apache.maven.plugins:maven-resources-plugin:resources</process-resources> | ||
<compile>org.apache.maven.plugins:maven-compiler-plugin:compile</compile> | ||
<process-test-resources>org.apache.maven.plugins:maven-resources-plugin:testResources</process-test-resources> | ||
<test-compile>org.apache.maven.plugins:maven-compiler-plugin:testCompile</test-compile> | ||
<test>org.apache.maven.plugins:maven-surefire-plugin:test</test> | ||
<package>de.dentrassi.maven:rpm:rpm</package> | ||
<install>org.apache.maven.plugins:maven-install-plugin:install</install> | ||
<deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy> | ||
</phases> | ||
</configuration> | ||
</component> | ||
</components> | ||
</component-set> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
------ | ||
RPM Builder Plugin - Example Primary Artifact | ||
------ | ||
Daniel Singhal | ||
------ | ||
2019-07-22 | ||
----- | ||
|
||
Example configuration #2 | ||
|
||
This is an example configuration showing how to use the plugin to create an RPM as the primary project artifact | ||
|
||
+----+ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>de.dentrassi.maven.rpm.test</groupId> | ||
<artifactId>emptyTest1</artifactId> <!-- used as package name --> | ||
<version>1.0.0-SNAPSHOT</version> <!-- used as version --> | ||
<packaging>rpm</packaging> <!-- Primary Artifact Configuration --> | ||
|
||
<name>Test Package #2 -- Primary</name> <!-- used for "summary" field --> | ||
|
||
<!-- used for "description" field --> | ||
<description> | ||
This is some long long text about foo bar and all the rest. | ||
</description> | ||
|
||
<url>http://dentrassi.de</url> <!-- used for URL field --> | ||
|
||
<!-- | ||
Packager: Jens Reimann <http:/dentrassi.de> | ||
Vendor: Jens Reimann | ||
--> | ||
<organization> | ||
<name>Jens Reimann</name> | ||
<url>http://dentrassi.de</url> | ||
</organization> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<!-- For managing PGP Signing of RPM --> | ||
<rpm.skipSigning>true</rpm.skipSigning> <!-- Primary Artifact Configuration(s) --> | ||
</properties> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>de.dentrassi.maven</groupId> | ||
<artifactId>rpm</artifactId> | ||
<version>${project.version}</version> | ||
<!-- Tell MVN that the plugin has a packaging option --> | ||
<extensions>true</extensions> <!-- Primary Artifact Configuration --> | ||
<executions> | ||
<execution> | ||
|
||
<goals> | ||
<goal>rpm</goal> | ||
</goals> | ||
|
||
<configuration> | ||
<attach>false</attach> <!-- don't attach RPM as a secondary artifact --> | ||
<group>Application/Misc</group> <!-- set RPM group --> | ||
|
||
<!-- rule sets --> | ||
|
||
<rulesets> | ||
<ruleset> | ||
<id>my-default</id> | ||
<rules> | ||
<rule> | ||
<when> | ||
<type>directory</type> | ||
</when> | ||
<mode>0750</mode> | ||
</rule> | ||
<rule> | ||
<when> | ||
<prefix>/etc/</prefix> | ||
</when> | ||
<configuration>true</configuration> | ||
</rule> | ||
<file> | ||
<when> | ||
<prefix>/usr/shar/doc/</prefix> | ||
</when> | ||
<documentation>true</documentation> | ||
</file> | ||
<file> | ||
<when> | ||
<suffix>README.txt</suffix> | ||
</when> | ||
<readme>true</readme> | ||
</file> | ||
<rule> | ||
<when> | ||
<type>file</type> | ||
<prefix>/usr/lib/foobar/lib/dir1</prefix> | ||
</when> | ||
<user>foo</user> | ||
<group>bar</group> | ||
</rule> | ||
</rules> | ||
</ruleset> | ||
</rulesets> | ||
|
||
<entries> | ||
|
||
<!-- add explicit directory --> | ||
|
||
<entry> | ||
<name>/etc/foo</name> | ||
<directory>true</directory> | ||
<user>root</user> | ||
<group>root</group> | ||
<mode>0755</mode> | ||
|
||
<!-- will use the default ruleset --> | ||
|
||
</entry> | ||
|
||
<!-- add single file --> | ||
|
||
<entry> | ||
<name>/etc/foo/bar.txt</name> | ||
<file>src/main/resources/bar.txt</file> | ||
<user>root</user> | ||
<group>root</group> | ||
<mode>0600</mode> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
|
||
<!-- collect all files from : target/classes --> | ||
|
||
<entry> | ||
<name>/usr/lib/foobar</name> | ||
<collect> | ||
<from>target/classes</from> | ||
</collect> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
|
||
<!-- collect all files from : src/main/resources/etc --> | ||
|
||
<entry> | ||
<name>/etc</name> | ||
<collect> | ||
<from>src/main/resources/etc</from> | ||
<directories>false</directories> <!-- make implicit directories --> | ||
</collect> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
|
||
<!-- collect all files from : src/main/resources/lib --> | ||
|
||
<entry> | ||
<name>/usr/lib</name> | ||
<collect> | ||
<from>src/main/resources/lib</from> | ||
<directories>true</directories> <!-- make explicit directories --> | ||
</collect> | ||
<ruleset>my-default</ruleset> | ||
</entry> | ||
|
||
</entries> | ||
|
||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> | ||
+----+ |