This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 1076e68 SLING-9469 : add configuration to replace manifest properties
values (#54)
1076e68 is described below
commit 1076e68f28718a9750eba1a4149481ba0da2388c
Author: Darshan Mahor <[email protected]>
AuthorDate: Mon May 25 15:14:52 2020 +0530
SLING-9469 : add configuration to replace manifest properties values (#54)
* SLING-9469| add configuration to replace manifest properties values
* SLING-9469 | add new values in Manifest via configuration
Co-authored-by: Darshan <[email protected]>
---
.../org/apache/sling/feature/maven/mojos/ApisJarMojo.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git
a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
index ea52ccd..9fc965f 100644
--- a/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
+++ b/src/main/java/org/apache/sling/feature/maven/mojos/ApisJarMojo.java
@@ -89,6 +89,7 @@ import
org.apache.sling.feature.extension.apiregions.api.ApiExport;
import org.apache.sling.feature.extension.apiregions.api.ApiRegion;
import org.apache.sling.feature.extension.apiregions.api.ApiRegions;
import org.apache.sling.feature.io.IOUtils;
+import org.apache.sling.feature.maven.ProjectHelper;
import org.apache.sling.feature.maven.mojos.apis.ApisJarContext;
import org.apache.sling.feature.maven.mojos.apis.ApisJarContext.ArtifactInfo;
import org.apache.sling.feature.maven.mojos.apis.ApisUtil;
@@ -339,6 +340,13 @@ public class ApisJarMojo extends
AbstractIncludingFeatureMojo {
@Parameter(defaultValue = "8")
private String javadocSourceLevel;
+ /**
+ * specify the manifest properties values that you need to replace in the
Manifest file.
+ * @since 1.3.2
+ */
+ @Parameter
+ private final Properties manifestProperties = new Properties();
+
private final Pattern pomPropertiesPattern =
Pattern.compile("META-INF/maven/[^/]+/[^/]+/pom.properties");
/** Artifact Provider. */
@@ -1582,6 +1590,9 @@ public class ApisJarMojo extends
AbstractIncludingFeatureMojo {
archiveConfiguration.addManifestEntry("Specification-Vendor",
project.getOrganization().getName());
}
+ // replace/add manifest entries with the one provided in
manifestProperties configuration
+
archiveConfiguration.addManifestEntries(ProjectHelper.propertiesToMap(manifestProperties));
+
final File target = new File(mainOutputDir, targetId.toMvnName());
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver(jarArchiver);